Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Localizing hash keys in an AoH

by kennethk (Abbot)
on Mar 15, 2013 at 18:54 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found