Hi Gary, On Wednesday 15 December 2010 14:42:56 Gary Stainburn wrote: > HI Shlomi, > > On Wednesday 15 December 2010 11:57:25 Shlomi Fish wrote: > [snip] > > > > while (<STDIN>) { > > > > > > my $line=$_; > > > > Why are you doing this instead of: > > > > [code] > > while (my $line = <STDIN>) > > { > > } > > [/code] > > For two reason, (1) I've not written Perl in ages and forgotten much of the > style and syntax and (2) I copied the code straight from an example on a > perl tutorial page. >
Ah, which Perl tutorial? Just so I see if it should be avoided. > > I should also note that normall <ARGV> (shortened as <>) is preferable to > > <STDIN>. See: > > > > http://perl-begin.org/tutorials/bad-elements/ > > I've read the page, and changed my code accordingly. > Nice. > Thank you. You're welcome. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ The Case for File Swapping - http://shlom.in/file-swap Chuck Norris can make the statement "This statement is false" a true one. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/