Help for this page

Select Code to Download


  1. or download this
    sub get_object
        {
    ...
        $url       = shift();
        $referer   = shift();
        $save_path = shift();
    
  2. or download this
        my($agent, $url, $referer, $save_path) = @_;
        # args:
    ...
        #   $referer   - referer to grab URL with (optional)
        #   $save_path - path to save image/etc. to (optional)
        my($request, $response, $content); # for http stuff
    
  3. or download this
        # ...
        $save_path ? print("Getting picture $url...") : print("Getting inf
    +o from $url\n");
    
  4. or download this
        print $save_path ? "Getting picture $url..." : "Getting info from 
    +$url\n";
    
  5. or download this
        print defined $save_path ? "Getting picture $url..." : "Getting in
    +fo from $url\n";
    
  6. or download this
    my $type = $response->headers->header("Content-Type");
    if (defined $type and $type =~ /^text/) {
    ...
    } else {
      # ... probably not text
    }