my %data; while( $html_page =~ m/([\w.]+)\s*=\s*([\w.-]+)/g ) { $data{$1} = $2; } print "$_ $data{$_}\n" foreach keys %data;