in reply to How do I get the last occurrence of a word (or words) in a file?
Or stated another way ... arn't hashes great?
Just for another style!while (<>) { /^(.+)\:/ ; # Capture Server Name $hash{$1} = $_ ; # Create Hash Key if found } foreach $server (sort keys %hash) { print "$hash{$server}\n" ; }
Have fun,
mslattery
In Section
Seekers of Perl Wisdom