Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to deal with long line

by philcrow (Priest)
on Sep 27, 2005 at 21:04 UTC ( #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? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2023-09-27 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?