use strict; use Data::Dumper; use HTML::LinkExtor; my $base = 'http://perlmonks.org/'; my $stringy = q{ How does this code work (warnings.pm)? by John M. Dlugosz Tk and X events by Anonymous Monk warnings::warnif etc. wise usage? by John M. Dlugosz 52-bit numbers as floating point by John M. Dlugosz }; my $p = new HTML::LinkExtor(undef, $base); $p->parse($stringy); print Dumper $p->links; $p = new HTML::LinkExtor( sub { print Dumper($_) for @_; } , $base); $p->parse($stringy);