in reply to Parsing named parameters
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Parsing named parameters
by robin (Chaplain) on Nov 07, 2005 at 15:12 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 15:18 UTC | |
by robin (Chaplain) on Nov 07, 2005 at 15:28 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 15:30 UTC | |
by robin (Chaplain) on Nov 07, 2005 at 15:45 UTC | |
|
In Section
Seekers of Perl Wisdom