Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Perl script to print Next line after Pattern Matching

by Anonymous Monk
on Dec 20, 2011 at 18:32 UTC ( [id://944445]=note: print w/replies, xml ) Need Help??


in reply to Perl script to print Next line after Pattern Matching

This should do it.
#!/usr/bin/perl use strict; local $/="\n\n"; while (<DATA>) { print "$1\n" if /Customer\sID:\sYes\n(.*)/; } __DATA__ Customer ID: none VT : 002/89 Customer ID: Yes VT: 001/89 Customer ID: none VT: 006/85 Customer ID: Yes VT: 003/56

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2026-04-13 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.