Take the time to learn the ways of
grep and
map. They are very powerful tools in the Swiss Army Knife of Perl.
Do a few
Perlmonks Google searches, check out some of the Monks' code snippets, and you will find some great examples of how grep and map are your friends.
Like these:
Map Tutorial: The Basics
Map and Grep