my $data = <DATA>; my %hash; $hash{$1} = $2 while $data =~ s/\s*(\w+)\s*=\s*([^=]+)$//; use Data::Dumper; print Dumper \%hash; __DATA__ option1 = value0 value1 value2 option3 =value3 value4 option2=value5
Not the fastest possible solution, but simple and concise.
In reply to Re: Parsing named parameters
by robin
in thread Parsing named parameters
by sk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |