#!/usr/local/bin/perl -w while (<>) { my @foo = do_stuff($_); print $foo[1]; } #### sub do_stuff { return split /a/, @_; }