in reply to Strange error from Response.pm

This is not one of my stronger areas, but my initial guess is that you haven't given us enough information. What sort of object is $webcrawler ? Have you tried stepping through with the debugger to find out why that sub in HTTP::Response is getting an undefined $base? Shouldn't you be assigning something to $url_name before using as an arg to  $webcrawler->get ?

While not being able to answer your real question, I'll point out that your grep regex should probably be like this:

my $exts = join( "|", qw/pdf doc ps txt/; @links = grep( !/\.(?:$exts)$/, @links );
The difference is in the period being treated as a literal period (your version treats it as a wildcard), and having the the set of alternative extension strings match only at the end of a link string (your version only matchs $ext3 (.txt) at the end of the string, and the others can match anywhere in the string).

(updated to fix grammar)