Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Search for Second Occurence of Substing and get containing text

by k_manimuthu (Monk)
on May 07, 2010 at 06:03 UTC ( [id://838864]=note: print w/replies, xml ) Need Help??


in reply to Search for Second Occurence of Substing and get containing text

For your code

if(Dumper($page) =~ /===Comments===(.*?)=Microarray Data=/s) { $lit_comments = $1; }

Search the match one time only

You want to do the stuff's repeated. You will use the while loop and use the 'g' (global modifier) in your code.

while(Dumper($page) =~ /===Comments===(.*?)=Microarray Data=/gs) { $lit_comments = $1; }

Otherwise. Try this

Dumper($page) =~ s/===Comments===(.*?)=Microarray Data=/&my_process($& +)/ges; sub my_process { my ($content)=@_; ## Do You stuff's Here return $content; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-19 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found