in reply to Passing an array into an open command
It looks like it should work. I tried the following on Win32 Active Perl 5.8.
test1.pl
test2.pl
UPDATE: Also works on Red Hat Linux 9. (Just change "test2.pl @a|" to "./test2.pl @a|" of course).
test1.pl
my @a; foreach(1..50){ $a[$_-1] = $_; } open(T, "test2.pl @a|"); while(<T>){ print; } close(T);
test2.pl
If I run test1.pl, I get 1..50 printed out on seperate lines, just like you would expect.foreach(@ARGV){ print "$_\n"; }
UPDATE: Also works on Red Hat Linux 9. (Just change "test2.pl @a|" to "./test2.pl @a|" of course).
- Tom
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Passing an array into an open command
by amw1 (Friar) on Mar 18, 2004 at 18:16 UTC | |
by tcf22 (Priest) on Mar 18, 2004 at 18:36 UTC |
In Section
Seekers of Perl Wisdom