use strict; use Data::Dumper; my %att = (PREEXISTING => "val1", ANOTHER => "Val2"); my $Incoming = q{uno="one" Blah blah dos="two" * More Noise* tres="three"}; while ($Incoming =~ m/\W*(\w+)="(.*?)"/g) { $att{uc $1} = $2; } print Dumper \%att;