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

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (strings)

What is the simplest method in perl of achieving the following from awk?
awk ' $2 ~ /localhost/ { print $0 } ' /etc/hosts

Originally posted as a Categorized Question.