@myHashArray = ( {toFind => ' Embedded', toReplace => 'External' }); Then I use this statement to find and replace the file. $data =~ s/$_->{toFind}/$_->{toReplace}/g foreach (@myHashArray);