in reply to Concatenating text for a hash problem
And now, for a totally different solution!
while (<DATA>) { my ($key) = /^>?(\S+)/; local $/ = '>'; chomp(my $val = <DATA>); $val =~ s/\n//g; $hash{$key} = $val; }
Redefining $/ is fun!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Concatenating text for a hash problem
by deibyz (Hermit) on Oct 15, 2004 at 11:17 UTC |