Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: multi-line parsing

by Nkuvu (Priest)
on Mar 31, 2009 at 18:40 UTC ( #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
Node Status?
node history
Node Type: note [id://754499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-08-13 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (73 votes). Check out past polls.

    Notices?