in reply to Re^5: $_ not set in while <>
in thread $_ not set in while <>

Oh, I see said the blind man to his deaf wife as he picked up his hammer and saw.

I suspect that something very simple like this would work:

use strict; use warnings; my $pattern ='ABC'; while (<>) { last if /$pattern/; } # processing of rest of file starts here... print "printing all lines after $pattern detected!\n"; while (<>) { print; }