http://www.perlmonks.org?node_id=160633


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?

while (<>) { /^(.+)\:/ ; # Capture Server Name $hash{$1} = $_ ; # Create Hash Key if found } foreach $server (sort keys %hash) { print "$hash{$server}\n" ; }
Just for another style!

Have fun,
mslattery