in reply to Pipe File contents into Perl Script
To put the file into an array:
my @file_lines = <>;
To read it line by line:
while ( my $line = <> ) { print "The line is: $line"; push @file_lines, $line; }
You might also want to look at chomp, if you don't want line endings on your lines.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pipe File contents into Perl Script
by smack (Beadle) on Sep 21, 2007 at 17:55 UTC | |
by kyle (Abbot) on Sep 21, 2007 at 18:00 UTC | |
|