in reply to Re: Use an incrementing counter as a variable (arrays)
in thread Use an incrementing counter as a variable

Anonymous one: Variations on this approach are

c:\@Work\Perl\monks\Anonymous Monk\1199083>perl -wMstrict -MData::Dump + -le "my @bin; ;; while(my $line = <>) { push @bin, $line; } ;; dd \@bin; " junk_1.txt ["line uno\n", "line two\n", "line 3\n"] c:\@Work\Perl\monks\Anonymous Monk\1199083>perl -wMstrict -MData::Dump + -le "my @bin = <>; ;; dd \@bin; " junk_1.txt ["line uno\n", "line two\n", "line 3\n"]
where junk_1.txt contains
line uno line two line 3
Both these variations relieve you of the need to maintain the  $counter counter (assuming it's initialized to 0).


Give a man a fish:  <%-{-{-{-<