in reply to Re: Regex not greedy enough
in thread Regex not greedy enough
Untested, but you might get some ideas from that.while (<DATA>) { my ($key, $value) = /(\S+) (.*)/ or next; # or: my ($key, $value) = split; # or: (undef, $key, $value) = split(/\s+/, $_, 3); $hash{$key} = $value; # or: push(@{$hash{$key}}, $value); }
|
|---|