danj35 has asked for the wisdom of the Perl Monks concerning the following question:
I've got a webpage I've passed to a variable and I need to take a section of text between one start and end point.
So for example I need everything between =Man= and =Woman= here:
=Man=
Is strong bla Is clever bla
=Woman=
Is probably not liking the comment stating that man is clever.
It would also be useful to take everything after =Woman= into a variable, without specifying an end point, so it would go all the way to the end of the page.
At the moment I can only get text between a start and end point on one line. Code for this is:
my $page = $mw->get_page( { title => $pagename } ); if(Dumper($page) =~ m/Daniel(.*?)world/) { print $1; }
Any help would be great, thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching string for paragraph..
by Ratazong (Monsignor) on May 06, 2010 at 12:59 UTC | |
by moritz (Cardinal) on May 06, 2010 at 13:08 UTC | |
|