Help for this page

Select Code to Download


  1. or download this
    $ ./1.lwp.pl 
    execution here
    execution there
    ...
    say "execution there";
    __END__
    $
    
  2. or download this
    # Set up configuration data
    use vars qw{%SUPPORTED @RELIABLE_HTTP};
    BEGIN {
    ...
                    'http://cnn.com/'                  => sub { /CNN/     
    +             },
            );
    }
    
  3. or download this
    use LWP::Simple 5.805 qw{ get $ua };
     
    use vars qw{$VERSION @ISA @EXPORT_OK};
    ...
            # Set the useragent timeout
            $ua->timeout(30);
    }
    
  4. or download this
    sub get ($)
    {
        my $response = $ua->get(shift);
        return $response->decoded_content if $response->is_success;
        return undef;
    }