Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Hashrefs and arrayrefs

by stephen (Priest)
on Apr 19, 2002 at 14:17 UTC ( #160549=note: print w/ replies, xml ) Need Help??


in reply to Hashrefs and arrayrefs

Your problem is that you are pushing the same variable reference into to list over and over. You need to localize %info with my, like so:

...snip... foreach $dir(@dirlist) { my %info; my $newdir=($dest."\/".$dir); if (-f $absdir."\/".$dir) { %info=( driver =>"working", ...snip...
It's an easy mistake to make... unless you've got use strict running. Turn on use strict. :)

stephen


Comment on Re: Hashrefs and arrayrefs
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://160549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (17)
As of 2014-08-22 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (161 votes), past polls