Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Re-orderable keyed access structure?

by Aristotle (Chancellor)
on Aug 14, 2004 at 04:56 UTC ( #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
Node Status?
node history
Node Type: note [id://382901]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2020-02-29 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (128 votes). Check out past polls.

    Notices?