Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: multi-line parsing

by Nkuvu (Priest)
on Mar 31, 2009 at 18:40 UTC ( [id://754499]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
        # Set the record separator to match the data.
        # In this example I have a blank line between
    ...
    First line of text
    second line of text
    in the third line I have 1.73205081
    
  2. or download this
        $/ = "First line of text";
    
        while (<DATA>) {
    ...
                print "Captured ($1)\n";
            }
        }
    
  3. or download this
    {
        $/ = undef;
        my $data = <DATA>;
    ...
            print "Captured $_\n";
        }
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found