Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2014-08-29 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (281 votes), past polls