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

Re^3: Re-orderable keyed access structure?

by Aristotle (Chancellor)
on Aug 14, 2004 at 04:56 UTC ( [id://382901]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @actual_data = (
        [ ... ],
    ...
    my $lookup_by_key = $actual_data[ $index_of{ 'bar' } ];
    my $lookup_by_idx = $actual_data[ 1 ];
    my $key_from_idx  = $key_for[ 1 ];
    
  2. or download this
    sub swap_elements_by_idx {
        my ( $i, $j ) = @_;
    ...
        @key_for[ $i, $j ] = @key_for[ $j, $i ];
        @index_of{ @key_for[ $i, $j ] } = @index_of{ @key_for[ $j, $i ] };
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found