Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Sort of anonymous hash

by larsss31 (Acolyte)
on Sep 30, 2009 at 08:12 UTC ( [id://798251]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Sort of anonymous hash
in thread Sort of anonymous hash

It is, indeed.
ikegami's response was surely the most correct, because with no transformation involved, direct access is always faster.

My question was to illustrate a point, i.e. if there was some perl placeholder to accomodate for an anonymous hash being created by another function.

Replies are listed 'Best First'.
Re^4: Sort of anonymous hash
by ikegami (Patriarch) on Sep 30, 2009 at 10:31 UTC
    Yes. They're called variables.
    for my $d (sort {$descs->{$a} cmp $descs->{$b}} keys %{ $descs = {map +{$_ => $hash{$_}{desc}} keys %hash}} ) { ... ... }
      You made me laugh (for real!) Anyway, inline declaration is actually the solution closest to what i initially thought. Thanks and have a nice day

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-04-24 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found