So, if I put a filehandle in the diamond, instead of empty diamond,
does that mean that the first would operate line by line and the
second would pull the whole file into memory?
Thanks much,
Jen
On Apr 6, 2007, at 9:31 AM, Jeff Pang wrote:
: Re: Text munging problem: question on while loop differences
What is the difference between:
a. while(defined(my $line = <>)) ...
and
b. while(<>)
Hello,
When you say "my $line = <>" you read the content from input (maybe
file or terminal STDIN or pipe) line by line and store it on
variable $line.but when you just say "while(<>)" this would store
each line on Perl's builtin variable $_.
--
mailto: [EMAIL PROTECTED]
http://home.arcor.de/jeffpang/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/