use strict; open FH, '<', 'filename'; foreach () { print $_ if /^\@/; } close FH;