Here is my sample code. i am getting the source code in the $res variable. Initially i am loading the wait message. the page will take some seconds to load. So we need to wait/sleep before extracting the source code
use lwp::useragent;
my $ua=lwp::useragent->new();
my $res= $ua->get(http://mytestpage.com);
if ($res->is_success){