try this
use LWP::Simple qw/get $ua/;
use HTML::Parser;
$ua->agent( "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" );
my $data = get( 'http://google.com/' );
HTML::Parser->new( start_h => [sub { print shift->{href}, "\n" if ( shift eq 'a' ) }, 'tagname, attr'], )->parse( $data ) || die...