my ($START, $STOP) = qw(START STOP); while () { $where = /$START/../$STOP/; if ($where and $where > 1 and $where !~ /E0/) { print "PRINTING\n"; } else { print "not printing"; } } __END__