mr. jaggers has asked for the wisdom of the Perl Monks concerning the following question:
Okay, so here is a test loop to populate an array of hashes, each hash containing some useful stuff about each three-tuple./bin/perl test.pl input out1 0,2,4,6 0,1,2,3 out2 1,3,5,7 0,1,2,3
Well, the wierd thing is that the second to last print statement prints something like:for ($ii=1;$ii<=@ARGV-1;$ii+=3) # three-tuples (outfile, map1, map2) { $files[(($ii-1)/3)]{fname}=$ARGV[$ii]; $files[(($ii-1)/3)]{fhandle}= new IO::File ">".$files[(($ii-1)/3)]{f +name}; $files[(($ii-1)/3)]{map1}=[split /,/,$ARGV[$ii+1]]; print "map1 : [" . join /,/,$files[(($ii-1)/3)]{map1} . "]\n"; print Dumper(@files); }
... instead of:map1 : [ARRAY(0x1dc518c)] $VAR1 = { 'fname' => 'out1', 'map1' => [ '0', '2', '4', '6' ], 'fhandle' => bless( \*Symbol::GEN0, 'IO::File' ), }; . . .
I've tried adding various brackets and parens (admittedly, not the best way to debug) to try to ensure proper context, but to no avail.map : [0,2,4,6] . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Join returning array reference, not string... why?
by Zaxo (Archbishop) on Dec 24, 2002 at 02:39 UTC | |
by mr. jaggers (Sexton) on Dec 24, 2002 at 02:41 UTC | |
|
Re: Join returning array reference, not string... why?
by gjb (Vicar) on Dec 24, 2002 at 02:28 UTC | |
by mr. jaggers (Sexton) on Dec 24, 2002 at 02:38 UTC |