#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @data = ( {unit => 'S', value => 50, }, {unit => 'T', value => 60, }, {unit => 'Q', value => 70, }, ); # Works LOCAL_BLOCK_1: { local $data[0]{unit} = 'S'; local $data[1]{unit} = 'S'; local $data[2]{unit} = 'S'; print Dumper \@data; } print Dumper \@data;