Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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
[shmem]: result := the discarded result (what's leftmost of the statement)
[shmem]: push returns the number of elements in @foo, the assignment returns all the elements in the (renewed) @foo
[Lady_Aleena]: Sanity check please? push @line, ref($list_addition ) eq 'ARRAY' ? @$list_addition : $list_addiction; # so I don't have the change existing uses of the sub.
[shmem]: $list_addiction should be $list_addition
Discipulus loose the tozzetto party!
[shmem]: .oO( addition of cookies for addiction to cookies )
[Lady_Aleena]: Other than my typos shmem. 8)
[shmem]: otherwise fine
[Discipulus]: tozzetti & vinsanto
[Lady_Aleena]: The whole line is push @line, ref($list_addition ) ? @$list_addition : $list_addition if $list_addition;

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-04-27 11:42 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (503 votes). Check out past polls.