The following code will do the required task. #! /usr/bin/perl
open (FILE,"test789.pl"); @array1 = <FILE>; $last = pop(@array1); print $last; --- Jeremy Kister <[EMAIL PROTECTED]> wrote: > On Wednesday, August 25, 2004 6:15 PM, I wrote: > > not extensively tested: > > this is a bit more tested: > > #!/usr/local/bin/perl > > open(F, "file.txt"); > while(<F>){ > chomp(my $line = $_); > my ($key) = $line =~ /^(\S+)\s/; > $hash{$key} = $line; > } > close F; > > foreach my $value (values %hash){ > print "$value\n"; > } > > Jeremy Kister > http://jeremy.kister.net/ > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > <http://learn.perl.org/> > <http://learn.perl.org/first-response> > > > ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>