Sure it can be done. But why bother when the
modules are there to make your life easier?
LWP::Simple, HTML::Parser (version 2) and HTML::LinkExtor
are all pure-Perl modules, so if you want to know how to
so it, just look at the source for these modules.