"R. Joseph Newton" <[EMAIL PROTECTED]> writes:
An example would be that I wanted to run a series of regex against each line of input (While in headers) grabing the matches into an array for printing.
Something like: [...] snipped getopts and other unrelated stuff while(<FILE>){ chomp; my $line = $_;
Why here. Since you are doing this with each line, you could write in the loop control: while (my $line = <FILE>) {
Not sure I understand the advantage. In my formulation, `$line' is minus the trailing newline... which I've found to be nearly always a plus.
then chomp that -
while (chomp(my $line = <FILE>)) {
smaller understandable -- the same as the orignal.
I believe that is what Joseph is referring, as well as the other sections...
-- _Sx_ http://youve-reached-the.endoftheinternet.org/ _____ perldoc -qa.a | perl -lpe '($_)=m("(.*)")' | grep Martian
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>