romy_mathew has asked for the wisdom of the Perl Monks concerning the following question:
#test-1.pl
my @array = (1,2,3,4,5);
my $test = \@array;
open (FILE, "| ./test-2.pl");
print FILE "$test";
close (FILE);
#...............close...........
#test-2.pl
foreach (<>) {
$temp = $_;
}
print "array = @$temp";
#.................. close............
Error : "Can't use string ("ARRAY(0x26158c0)") as an ARRAY ref while "strict refs" in use"
Any suggestion ...?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to pass array as a reference from one perl file to other
by moritz (Cardinal) on May 14, 2011 at 19:45 UTC | |
|
Re: How to pass array as a reference from one perl file to other
by PyrexKidd (Monk) on May 14, 2011 at 21:41 UTC | |
by Gangabass (Vicar) on May 15, 2011 at 09:07 UTC | |
by romy_mathew (Beadle) on May 15, 2011 at 16:01 UTC | |
by romy_mathew (Beadle) on May 15, 2011 at 19:52 UTC | |
|
Re: How to pass array as a reference from one perl file to other
by John M. Dlugosz (Monsignor) on May 15, 2011 at 04:46 UTC | |
by Anonymous Monk on May 15, 2011 at 15:52 UTC | |
by lidden (Curate) on May 15, 2011 at 20:06 UTC |