Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Extracting values from nested hashrefs

by Athanasius (Chancellor)
on Sep 12, 2012 at 12:46 UTC ( #993220=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #! perl
    use strict;
    ...
    
    my $flat = Dumper($animals);
    print "$1\n" while $flat =~ / 'humps' \s+ => \s+ (\d+) /gx;
    
  2. or download this
    2
    0
    1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993220]
help
Chatterbox?
[1nickt]: I have encountered a small code snippet I can not decipher: if ($?) { my $status = $? >> 8; ... }
[1nickt]: Hm, found the doc
[hippo]: >> is the bitwise shift, essentially divides the result by 256.
[haukex]: $? and system - the exit code of a process is stored in the upper bits of $?, so >> 8 does a bit shift to get at it
[hippo]: (truncating)
[erix]: aah, yes haukex++
[hippo]: Re: DBD::Sqlite queries slow - and gives wrong results has 6 upvotes. Is everyone quite well?
[erix]: hippo I think the 26 downvotes sick
[erix]: eh, 29 downvotes
[erix]: but I guess there's no stopping the herd

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-12-13 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (359 votes). Check out past polls.

    Notices?