in reply to Parsing Challenge
ormy %hash = split /=|\b(?=\S+=)/, $data; $hash{$_} = [ split / /, $hash{$_} ] for keys %hash;
or to support repeated keys:my %hash; $hash{$1} = [split / /, $2] while $data =~ /(\S+)=(.*?)(?=\S+=|$)/g;
my %hash; push @{$hash{$1}}, split / /, $2 while $data =~ /(\S+)=(.*?)(?=\S+=| +$)/g;
MeowChow s aamecha.s a..a\u$&owag.print
|
|---|