in reply to Re: Localizing hash keys in an AoH
in thread Localizing hash keys in an AoH
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @data = ( {unit => 'S', value => 50, }, {unit => 'T', value => 60, }, {unit => 'Q', value => 70, }, ); LOCAL_BLOCK: { my $cmd; $cmd .= "local \$data[$_]{unit} = 'S';\n" for 0 .. $#data; $cmd .= 'print Dumper \@data'; eval $cmd; } print Dumper \@data;
I'll do some digging on the cited modules, to see if they work in my context.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|