in reply to Strange Log
It being your first script, I won't beat you over the head with the CPAN bat. However, using regular expressions to parse HTML is generally considered a no-no. It'd probably be better to use HTML::Parser or, my personal favorite, HTML::TokeParser:
use HTML::TokeParser; # ... my $p = HTML::TokeParser->new($source); while (my $tag = $p->get_tag("img")) { push @src, $tag->[1]{src}; } # ... foreach my $src (@src) { print LOG $src, "\n"; } # ...
For more information, see the docs on HTML::TokeParser.
Also, crazyinsomniac twisted my arm to mention HTML::TokeParser Tutorial. There, I said it.
[ ar0n ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (ar0n) Re: Strange Log
by joealba (Hermit) on Nov 23, 2001 at 10:17 UTC |