Re: Problem for the Perl meisters


Subject: Re: Problem for the Perl meisters
From: Arthur Corliss (arthur@corlissfamily.org)
Date: Thu Jun 06 2002 - 06:31:16 AKDT


> Writing a script for ActiveState's ActivePerl 5.6.1 which (if the
> darn thing worked) would do the same thing on a Windows box (with
> Perl installed, of course) that wget does on a Linux box.

<snip>

> $link_extor = HTML::LinkExtor->new(\&handle_links);

<snip>

> Obviously, the sub is not evaluated. Anybody got any idea how come?
> According to Active...'s web docs the syntax of the calling line (starting
> with $link_extor = ) is OK; the second parameter is optional.

Look at your code: you've only instantiated an instance of an HTML::LinkExtor
object (and given it a sub to use). That's great, but you never told it to
actually *do* anything, which is why you aren't seeing anything.

Do a 'perldoc HTML::LinkExtor' from a cmd shell. You'll see that you'll need
to call a parse method to have it actually process your text. The syntax is
in the docs, so have fun. :-)

--

--Arthur Corliss Bolverk's Lair -- http://arthur.corlissfamily.org/ Digital Mages -- http://www.digitalmages.com/ "Live Free or Die, the Only Way to Live" -- NH State Motto

--------- To unsubscribe, send email to <aklug-request@aklug.org> with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Fri Jun 07 2002 - 00:22:20 AKDT