Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: question about multi value hash key

by kyle (Abbot)
on Mar 31, 2009 at 22:06 UTC ( [id://754553]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
        time       => $time,
    ...
        type       => $value2,
        comment    => $value3,
    }
    
  2. or download this
    push @AoH, { time => $t, conference => $v1, ... };
    
  3. or download this
    my @sorted_AoH = sort { $_->{time} <=> $_->{time} } @AoH;
    foreach my $conf ( @sorted_AoH ) {
        my $time = $conf->{time};
        print ... # element
    }
    
  4. or download this
    push @{ $hash{$time} }, { time => $time, type => $v2, ... };
    
  5. or download this
    for my $time ( sort keys %hash ) {
        for my $conf ( @{ $hash{ $time } } ) {
            print ... # $conf element
        }
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-23 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found