Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^6: $_ not set in while <>

by Marshall (Canon)
on Jun 06, 2021 at 07:34 UTC ( #11133579=note: print w/replies, xml ) Need Help??


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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133579]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2021-07-26 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?