while(<>) { tr/\r//d; # get rid of the CR print if /^\@QUERY/ .. /^\@ENDQUERY/; }