All pastes #523539 Raw Edit

Something

public text v1 · immutable
#523539 ·published 2007-05-30 20:32 UTC
rendered paste body
#!/usr/bin/perl -w

use WWW::Curl::easy;
sub chunk { my ($data,$pointer)=@_; ${$pointer}.=$data; return length($data) }

my      $url = "http://whatismyip.com";
my      $body = "";
my      $headers = "";

my      $curl = WWW::Curl::easy->new;
my      $code = $curl->setopt(CURLOPT_WRITEFUNCTION, $chunk);
        $code = $curl->setopt(CURLOPT_FILE, $body);
        $code = $curl->setopt(CURLOPT_FILE, $headers);
        $code = $curl->setopt(CURLOPT_URL, $url);
        $curl->perform;