Endless Loop
From: Bolcato Chris (esm1cmb_at_ups.com)
Date: 07/29/04
- Next message: Kamal Gupta: "RE: Modifying @INC"
- Previous message: James Edward Gray II: "Re: deleting HTML tag...but not everyone"
- Next in thread: Bob Showalter: "RE: Endless Loop"
- Maybe reply: Bob Showalter: "RE: Endless Loop"
- Reply: James Edward Gray II: "Re: Endless Loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Thu, 29 Jul 2004 10:23:53 -0400
This may be a dumb question, but why will this loop not end when nothing is
entered in STDIN?
print "Enter Things:\n";
while (<STDIN>) {
print "I saw $_";
}
print "The End\n";
If nothing is entered the loop continues.
Output:
I saw red
I saw yellow
I saw
I saw
I saw
- Next message: Kamal Gupta: "RE: Modifying @INC"
- Previous message: James Edward Gray II: "Re: deleting HTML tag...but not everyone"
- Next in thread: Bob Showalter: "RE: Endless Loop"
- Maybe reply: Bob Showalter: "RE: Endless Loop"
- Reply: James Edward Gray II: "Re: Endless Loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]