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

Re: Help with better complex hash processing

by YuckFoo (Abbot)
on Sep 27, 2006 at 18:46 UTC ( #575220=note: print w/replies, xml ) Need Help??

in reply to Help with better complex hash processing

If you just wanna get rid of the long series of dereferences that tend to uglify the code and cause much typing, save each step of dereference inside each loop.


for my $nkey (keys %$exception_report) { my $node = $exception_report->{$nkey}; print "Exceptions for $nkey:\n\n"; for my $ekey (keys %$node) { my $exception = $node->{$ekey}; for my $fkey (keys %$exception) { my $file = $exception->{$fkey}; while ( my ($metric, $value) = each %$file) { print "\t$ekey : ($fkey) $metric = $value\n"; } } } }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575220]
[Corion]: marto: But that aside, I hope you are well!
Corion is slowly acclimatizing to working only four days a week
[marto]: the back pain is still there, it's been a rough week, trying to do building work with a bad back
[Corion]: marto: Ow! That doesn't sound good :-/ The work won't help your back...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2017-09-21 14:42 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (248 votes). Check out past polls.