Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Comparing Hash key with array

by packetstormer (Monk)
on Feb 02, 2012 at 16:44 UTC ( #951484=note: print w/ replies, xml ) Need Help??


in reply to Re: Comparing Hash key with array
in thread Comparing Hash key with array

OK - I will try and get a complete data dumper set of the date. In the meantime this seems to be my problem:

foreach my $key(keys %ret) { my $value = $ret{$key}; my @arr = @$value; print "$key\n"; foreach my $u(@lines) { print "$key @$u\n"; } }
The first FOREACH (if on it's own will print out the correct amount of keys in the hash.
However, as soon as I add the second FOREACH (to enter the array) the keys get replicate the same amount of times the loop iterates.


Comment on Re^2: Comparing Hash key with array
Download Code
Re^3: Comparing Hash key with array
by Anonymous Monk on Feb 02, 2012 at 17:00 UTC

    OK - I will try and get a complete data dumper set of the date.

    It isn't really necessary, simply type/copy/paste to make %hash (or %ret) look the way you want.

    In the meantime this seems to be my problem

    Thanks, but I knew this much from your original posting, I can't infer your intent -- you use == to compare strings, and you switched from %hash to %ret

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-12-19 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (81 votes), past polls