@who = grep { /\bjoebloe\b/ } `who`; #### foreach $who (@who) { # ... do something with $who }