in reply to pushing similar lines into arrays
This'll give you a hash like:while (<>) { my ($key,$rest) = split; $hash{$key} ||= []; push(@{$hash{$key}}, $_); }
( 243_405 => [ "243_405 35 23 13", "243_405 46 21 15" ], 241_333 => [ "241_333 65 32 20", "241_333 52 44 11" ] )
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: pushing similar lines into arrays
by davido (Cardinal) on Mar 18, 2004 at 06:28 UTC | |
by etcshadow (Priest) on Mar 18, 2004 at 07:47 UTC | |
by davido (Cardinal) on Mar 18, 2004 at 07:58 UTC |