# untested while (<>) { my ($mon, $day, $time, $rtr, $seqno, $rmon, $rday, $rtime, $rtz, $code, $msg) = split(' ', $_, 11); next unless $code =~ m!\%SEC-6-IPACCESSLOGP:|\%SEC-6-IPACCESSLOGDP:!: # process stuff here, ala: my (undef, $listno, $act, $proto, $src, undef, $trget, $other, $cnt, ) = split(' ', $msg); }