Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Localizing hash keys in an AoH

by kennethk (Abbot)
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 meditating upon the Monastery: (5)
As of 2015-03-29 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (628 votes), past polls