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";
}
------------------------------------------------

Hope this helps...

Thanks, 

Ted Kender  <mailto:[EMAIL PROTECTED]> 
Personal Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
SBC Services/Enterprise Network Operations
Enterprise Applications Development and Support
Office: (317)265-1885 
Pager: (317)928-0558 <mailto:[EMAIL PROTECTED]> 

Data is not facts.
Facts are not knowledge.
Knowledge is not truth.
Truth is not wisdom.
Wisdom is neither eternal nor sufficient.

-----Original Message-----
From: Kenneth Singleton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 21, 2001 12:56 AM
To: [EMAIL PROTECTED]
Subject: populating a hash from a text file


Yes, I know this should be very easy. Yes I've seen the exercise in
"Learning Perl". Still I can't get the darned thing to work. Please help me.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to