$START = 'START'; $END = 'END'; while (<>) { if (/$START/../$END/) { print "inside\n"; } else { print "outside\n"; } }