Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Bidirectional lookup algorithm? (Updated: further info.)

by BrowserUk (Patriarch)
on Jan 04, 2015 at 21:14 UTC ( [id://1112131]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %intByStr = populate();
    my %strByInts; $strByInt{ intByStr{ $_ } } = $_ for keys %intByStr;
    ...
    
  2. or download this
    $i=1; $intByStr{ $_ } = $i++ for 'aaaa'..'zzzz';;
    
    ...
    print total_size( $_ ) for \(%intByStr, %strByInt);;
    50805928
    44297159
    
  3. or download this
    undef %AbyB; $i=1; $AbyB{ $_ } = $i, $AbyB{ $i++ } = $_  for 'aaaa'..'
    +zzzz';;
    
    print total_size( \%AbyB );;
    80479783
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1112131]
Approved by marto
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found