Re: Processing a web page (or looping over a multi line string)
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 28 Dec 2005 08:52:37 -0800
Jason wrote:
> The problem I'm trying to solve:
> There's a status web page that this program needs to check. Any line
> that matches:
> ^\s<td>some information</td>
> is one that I need to process. I just need the 'some information'
> part.
>
> I found LWP::Simple, and I'm getting the webpage with 'get $url'. The
> problem is I can't figure out how to loop over the lines of HTML to
> find what I want.
>
> I've tried:
>
> my $content = get $url;
$content is one big scalar. One single string. If you want to operate
on the "lines" contained in that string, you'll have to tell Perl what
a "line" is, first:
foreach my $line (split /\n/, $content) {
process_line($line);
}
Hope this helps,
Paul Lalli
.
- Follow-Ups:
- References:
- Prev by Date: Processing a web page (or looping over a multi line string)
- Next by Date: Each char / letter --> array from string value
- Previous by thread: Processing a web page (or looping over a multi line string)
- Next by thread: Re: Processing a web page (or looping over a multi line string)
- Index(es):