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 chester (Hermit)
on Sep 27, 2005 at 20:47 UTC ( #495550=note: print w/ replies, xml ) Need Help??


in reply to How to deal with long line

Here's one way that reads in the string a little bit at a time, which is good if your data is very large. Mostly untested, but works for your data:

use warnings; use strict; my @wanted_substrings; { local $/ = 'END'; while(my $string = <DATA>) { push @wanted_substrings, ($string =~ /START(.*)END/); } } print "@wanted_substrings"; __DATA__ somecharSTARTfvENDsomecharSTARTsvENDsomecharSTARTtvENDsomechar


Comment on Re: How to deal with long line
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-23 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls