The issue is more about appropriate tools for the job than hammering various shaped pegs into whatever hole you have.
- use grep to get an output list that is a subset of an input list
- use map to transform an input list into an output list
- use for to iterate over a list (and almost never use the C version of for)
- use a hash to look up keyed data quickly
- use an array to lookup indexed data quickly
- because hash keys are unique a hash is a good tool for finding unique strings in a bag of strings
Perl is environmentally friendly - it saves trees