Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
...page goes for a while...
<h1>Random Movie Quote</h1>
...quote goes here...
<P><form method=get action="/Games/randomquote.html">
...and page keeps going...
I get the site using LWP::Simple's get() command, and store it in a scalar. I then try to regexp the scalar, by saying
which I assumed would get the quote, which is always in between those two strings. However, it always grabs the entire $content string back again. I assume this means it couldn't find a match, but I'm not sure. Any helpful hints? What's the stupendously obvious thing I'm overlooking? (I did try searching the archives and didn't find anything helpful)$content =~ s#.*<h1>Random Movie Quote</h1>(.*)<P><form method=get act +ion="/Games/randomquote.html">.*#$1#;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting a chunk of an HTML string?
by wog (Curate) on Oct 13, 2001 at 03:56 UTC | |
by tommyw (Hermit) on Oct 13, 2001 at 04:08 UTC | |
|
Re: Getting a chunk of an HTML string?
by thatguy (Parson) on Oct 13, 2001 at 04:04 UTC |