else local @data would initialize empty. (At least it does, in my tests).local @data = @data;
Update: this works:
Update 2: Just noticed kennethks solution below, that changes @data to a package (our) variable, and allows it to be localized.LOCAL_BLOCK_5: { local @data[0..$#data]; $_->{unit} = 'S' for @data; print Dumper \@data; }
"I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
-- Dr. Cox, Scrubs
In reply to Re^2: Localizing hash keys in an AoH
by NetWallah
in thread Localizing hash keys in an AoH
by kennethk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |