Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Localizing hash keys in an AoH

by kennethk (Monsignor)
on Mar 15, 2013 at 18:54 UTC ( #1023759=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    }
    
    print Dumper \@data;
    
  2. or download this
    # Doesn't work
    LOCAL_BLOCK_2: {
        local $data[$_]{unit} = 'S' for 0 .. $#data;
    ...
    #    
    #    print Dumper \@data;
    #}
    
  3. or download this
    LOCAL_BLOCK: {
        my @units = map $_->{unit}, @data;
        $_->{unit} = 'S' for @data;
    ...
    
        $data[$_]{unit} = $units[$_] for 0 .. $#data;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1023759]
Approved by tobyink
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (16)
As of 2014-07-22 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (113 votes), past polls