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

Re: Recursively walk a hash to get to an element

by tlm (Prior)
on Mar 31, 2005 at 02:00 UTC ( [id://443660]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    { \($$a->{$b}) }
    
  2. or download this
    % perl rec_walk.pl
    Can't call method "List::Util::reduce" on unblessed reference at rec_w
    +alk.pl line 9.
    
  3. or download this
    use strict;
    my %myhash;
    ...
      require List::Util;
      return List::Util::reduce { \($$a->{$b}) } \shift, @_;
    }
    
  4. or download this
    use List::Util 'reduce';
    sub pointer_to_element {
      return reduce { \($$a->{$b}) } \shift, @_;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found