Entry
How to create name/value from string based on equal sign?
Dec 1st, 2004 09:12
Nat Tuck, Guest,
If you have the $string
"this=that monkeys=red stuff=purple bob=tuna"
you can say
@pairs = split /\s+/, $string;
foreach $p (@pairs) {
($k, $v) = split /=/, $p;
$hash{$k} = $v;
}