use strict; use Data::Dumper; my $Incoming = 'uno="one" Blah blah dos="two" * More Noise* tres="three"'; my %att= (PREEXISTING=>"val1", ANOTHER=>"Val2"); my %temp = $Incoming=~m/\W*(\w+)="([^"]+)"/ig; $att{uc $_}=$temp{$_} for keys %temp; print Dumper \%att; #--- Output -- #$VAR1 = { # 'TRES' => 'three', # 'UNO' => 'one', # 'DOS' => 'two', # 'ANOTHER' => 'Val2', # 'PREEXISTING' => 'val1' # };