in reply to Search Algorithm

I would use the great grep command instead of your 3rd loop.
This is out of the Perl Cookbook p 114
@matching = grep { /^gnat/ } `who`
This matches anything that comes out of the who command with the regular expression ^gnat

--BigJoe

Learn patience, you must.
Young PerlMonk, craves Not these things.