perl -le 'print $_ for grep{/pattern/}@arr'