RE: populating a hash from a text file

2001-11-21 Thread KENDER, TED (AIT)
Perl version of sort -u -t'|' +1... #!/usr/bin/perl my %list; my $line; my @line; while () { chomp; $line = $_; @line = split(/\|/, $line); $list{$line[0]} = $line; } foreach $line (sort keys %list) { print $list{$line}\n; }

Re: populating a hash from a text file

2001-11-21 Thread Randal L. Schwartz
Kenneth == Kenneth Singleton [EMAIL PROTECTED] writes: Kenneth Yes, I know this should be very easy. Yes I've seen the Kenneth exercise in Learning Perl. Still I can't get the darned Kenneth thing to work. Please help me. What have you tried? Does this example help? my %lastname;