in reply to pushing similar lines into arrays

I know I'm a little late, but I like these little 'perl-doodles'. Here's how I'd do it.

use strict; use warnings; my %hash; while ( <DATA> ) { chomp; my ( $key, $value ) = split /\s+/, $_, 2; push @{$hash{$key}}, $value; } print "$_: @{$hash{$_}}\n" foreach keys %hash; __DATA__ 243_405 35 23 13 243_405 46 21 15 241_333 65 32 20 241_333 52 44 11

...tested, of course.


Dave