while(<>) { tr/\r//d; print if /^\@QUERY/ .. eof; }