Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

4Re: Matching over multiple lines in a scalar

by thpfft (Chaplain)
on Oct 28, 2002 at 00:03 UTC ( #208415=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Matching over multiple lines in a scalar
in thread Matching over multiple lines in a scalar

after a tactful /msg from chromatic, i can confirm that this works too, provided the data are very tidy indeed.

(i wish someone would redefine data as the mass noun it surely is, then I could stop pedantically pluralising around it.)

my (undef, %lines) = split(/(\d+): /, join('', <DATA>));

ugly, fragile and unwise, but you know, short.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2021-05-06 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (81 votes). Check out past polls.

    Notices?