Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

zentara's scratchpad

by zentara (Archbishop)
on Jun 02, 2004 at 12:16 UTC ( #359375=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl use warnings; use strict; use HTTP::Request::Common qw(GET); use LWP::UserAgent; my $url =''; my $filename = substr( $url, rindex( $url, "/" ) + 1 ); #print "$filename\n"; open( IN, ">$filename" ) or die $!; my $user = 'zentara'; my $pass = 'foobar'; my $expected_length; my $bytes_received = 0; my $ua = new LWP::UserAgent; $ua->protocols_allowed( [ 'https'] ); #setup request my $req = GET($url); $req->authorization_basic($user, $pass); #do it my $response = $ua->request($req); if ($response->is_error()) { printf " %s\n", $response->status_line; print "https request error!\n"; } else { my $content = $response->content(); print IN $content; } print $response->status_line; close IN; exit;
Log In?

What's my password?
Create A New User
[erix]: I thaught it was a poor's workhouse (~19th C) - lemme look it up...
Discipulus has decided to use old english because of 'thou'..
[erix]: hm, apparently almshouses are still around
[Discipulus]: yes poor's workhouse, what they had more than their souls and some bone?
[LanX]: erix alms = Almosen
[erix]: yeah, Aalmoes (Niederlaendisch)
[erix]: italian alma may be unrelated
[choroba]: Alma in Hungarian is apple
[choroba]: Alma
[erix]: "may I eat your soul?"

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2017-11-23 20:19 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (338 votes). Check out past polls.