in reply to Is this a logic bug or a perl bug?
See the foreach at the top? It's storing data in $_. Then you're using $_ in your while loop also. The second is stomping on what's in the first. Do aforeach(@suffix) { $sf = $_ ; print STDERR "$mn $sd $sf\n" ; # Build the filename of the data file we want $fn = "$sd/data." . $sf ; open(DATA, "<$fn") || print "Failed to open $fn\n" ; # Store the data in a multidimensional hash (this will + overwrite + the hash, but that's # not the problem with this bug. while(<DATA>) { $v{$mn}{$sd}{$sf} = $_ ; } ....
At least that's what grabbed my attention first.while ($foo = <DATA>) { $v{$mn}{$sd}{$sf} = $foo; }
Rich
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Is this a logic bug or a perl bug?
by premchai21 (Curate) on Aug 17, 2001 at 21:44 UTC | |
|
Re: Re: Is this a logic bug or a perl bug?
by weltyj (Novice) on Aug 17, 2001 at 21:48 UTC |