Arun P Menon wrote:
Hello All,

Hello,

Could you tell me what does the following do?
1 while (<>);

That reads through all the files listed on the command line, or if there are no files listed on the command line then it reads through STDIN, and does nothing with the lines read, but does set $. to the total lines read.


Also, how does 'eval' work and when is it useful? What is the difference if
we put a block inside eval like: eval ( <block> };

eval interprets a string as Perl code and compiles and runs it. If you are using a block eval then the block must be valid Perl code and it is useful for capturing errors or warnings in the $@ variable.

perldoc -f eval



John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to