Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Matching over multiple lines in a scalar

by thpfft (Chaplain)
on Oct 27, 2002 at 23:18 UTC ( #208400=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $info = do { local $/; <DATA> };
    my %lines = $info =~ /(\d+): ([^\d]+)/gs;
    
  2. or download this
    my ($key, %data);
    for (<DATA>) {
    ...
        push @{ $data{ $key = $1 || $key } }, $2;
     
    }
    

Log In?
Username:
Password:

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

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





    Results (81 votes). Check out past polls.

    Notices?