Re: Processing a web page (or looping over a multi line string)
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 28 Dec 2005 12:00:45 -0800
Jason wrote:
> I found a solution. Here's what I ended up doing:
>
> my $content = get $url;
> die "Couldn't get $url" unless defined $content;
>
> while ($content =~ m/<td>/g) {
> #lots of pos hacking with m/?/g
That's... a really, really terrible idea.
1) What if the HTML you happen to retrieve doesn't have any tables?
2) Your "pos hacking" is likely difficult to read and therefore
difficult to maintain
3) WHY would you want to do that, instead of splitting on newlines, as
I said in my response? You said you wanted to process the file line by
line, so just do that.
I'm thoroughly confused by your desire to use this "solution"
Paul Lalli
.
- References:
- Prev by Date: Re: Each char / letter --> array from string value
- Next by Date: running a short perl script in a windows XP arena
- Previous by thread: Re: Processing a web page (or looping over a multi line string)
- Next by thread: Each char / letter --> array from string value
- Index(es):