in reply to user and pass in IO socket
my $ua = LWP::UserAgent->new( keep_alive => 1 ); my $request = new HTTP::Request GET => "http://www.perlmonks.org"; $request->authorization_basic("username", "password"); my $response = $ua->request($request); if ($response->is_success) { print STDOUT $response->content; } else { print STDERR "Error retrieving page!\n"; };
This combination, not only allows you to authenticate against the web server that you are retrieving the web page from, but you can also make use of proxy network configurations and exert greater control over the request and subsequent response.
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
|
|---|