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

Re: How to deal with long line

by philcrow (Priest)
on Sep 27, 2005 at 21:04 UTC ( [id://495559]=note: print w/replies, xml ) Need Help??


in reply to How to deal with long line

This is an ideal case for extract_tagged method of Text::Balanced. From the perldoc, I think you should say something like:
my $remainder = $original_string; my @answers; while ( defined $remainder ) { my $extracted; ( $extracted, $remainder ) = extract_tagged( $remainder, 'START', 'END', undef, { bad => ['START'] }, ); push @answers, $extracted; }

Phil

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-29 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found