in reply to references--hard vs anonymous operational weirdness
Thanks for your prompt and interesting attention. However, the array in question is defined inside the loop. A bit more of the code would certainly help the explanation.
opendir THISDIR, "."; while ($file = readdir THISDIR) { if ($file =~ /csv$/i) { open(INPUT, "$file") or die "Could not open $file. \n"; @array = <INPUT>; ($tab) = ($file =~ /.*\.(T\w+)\./); # Separate tab number from +file name $data{$tab} = [@array]; close INPUT; } }
This one seems to work. With the \@array structure each array is correct when established but is over written the next time through the loop. Ideas??
Many thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: references--hard vs anonymous operational weirdness
by ysth (Canon) on Mar 23, 2008 at 07:47 UTC | |
by hill (Sexton) on Mar 24, 2008 at 02:18 UTC |