in reply to working with files

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