Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^3: Help with Hash of hashes, is there a better way?

by ikegami (Pope)
on Jun 01, 2006 at 09:24 UTC ( #553004=note: print w/replies, xml ) Need Help??

in reply to Re^2: Help with Hash of hashes, is there a better way?
in thread Help with Hash of hashes, is there a better way?

Option 2)

A callback would be simpler:

{ iterate { my ( $env_name, $platform_name, $host_name, $target_name, $total_capacity, $free_capacity, ) = @_; local $, = "\t"; local $\ = "\n"; print $env_name, $platform_name, $host_name, $target_name, $total_capacity, $free_capacity; } $stuff; }
sub iterate(&$) { my ($callback, $envs) = @_; while (my ($env_name, $platforms) = each %{$envs }) { while (my ($platform_name, $hosts ) = each %{$platforms}) { while (my ($host_name, $targets ) = each %{$hosts }) { while (my ($target_name, $target ) = each %{$targets }) { my $total_capacity = $target->{total_capacity}; my $free_capacity = $target->{free_capacity}; $callback->( $env_name, $platform_name, $host_name, $target_name, $total_capacity, $free_capacity, ); }}}} }


Replies are listed 'Best First'.
Re^4: Help with Hash of hashes, is there a better way?
by TeraMarv (Beadle) on Jun 01, 2006 at 10:16 UTC

    Thanks ikegami,

    I like it, very cool. Something I would never have come up with myself....well at least not this year ;-)

    That's what I love about perlmonks, you always learn something useful.

    Thanks all Monks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553004]
[Corion]: Mr. Muskrat: I'm not sure if it really happens more often, but I don't exactly know either
[LanX]: yep
[LanX]: more often for some weeks now
[Corion]: I think I'll have to manually (as god) intervene with that node, as the simple reparenting didn't seem to fix the parent/child relationship of the nodes
[Corion]: I think I have an idea but I'll have to open a ticket with on that - hopefully I get to that on the weekend
LanX imagines a burning thorn bush
[Mr. Muskrat]: Thank you!
[Mr. Muskrat]: Oh that is odd. I got the message that it was reparented but yeah, it didn't actually do it. lol
[Corion]: LanX: No, Co-Rion appears as Monkey God :-)
[Corion]: Mr. Muskrat: Yeah, that message is automatic when the "normal" reparenting is done, but I think some rows that make up the node were not added to the DB properly

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-01-19 16:26 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.