in reply to pushing similar lines into arrays

Well, this smells like homework, but I'd do it like this:
use strict; my $head; my %hash; while (<>) { $head = (split)[0]; push @{$hash{$head}}, $_; }
Update: Sigh. I'm late.



Code is (almost) always untested.
http://www.justicepoetic.net/

Replies are listed 'Best First'.
Re: Re: pushing similar lines into arrays
by Phydro (Initiate) on Mar 18, 2004 at 05:18 UTC
    Thanks jweed, I will actually take that as a compliment (smells like homework). Actually, doing a project for work, and am but a wee yung'un in the Perl world...