smack has asked for the wisdom of the Perl Monks concerning the following question:
My script would then need to capture the contents of file.txt into an array. The following code does not accomplish this:script.pl < file.txt
#!/usr/local/bin/perl -w use strict; my $line; foreach $line (@ARGV) { print "The line is: $line\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pipe File contents into Perl Script
by kyle (Abbot) on Sep 21, 2007 at 17:26 UTC | |
by smack (Beadle) on Sep 21, 2007 at 17:55 UTC | |
by kyle (Abbot) on Sep 21, 2007 at 18:00 UTC | |
|