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