in reply to Cant figure out this part?
What is happening here is that you are passing in a reference to the subroutine 'cb' into the object $p which is a HTML::LinkExtor object.
By doing this $p can use the subroutine you provide so that you can customize the work being done on the extracted links. You seem to be printing them to a file, but lets say for example you wanted to build a spider, you could then write a sub spider { ... } that would traverse the links you find recursively. You would then create it with something like this:
use HTML::LinkExtor; my $p = HTML::LinkExtor->new(\&spider, "http://www.perl.com"); sub spider { # code omited } $p->parse_file("index.html");
Hope this helps.
-----------------------------------
|
|---|