#!/usr/bin/env perl use strict; use warnings; use WWW::Curl::Easy; use Perl6::Slurp; my $curl = new WWW::Curl::Easy; my $file = slurp("file.png"); my @values = ( ["key", "e7d4bf208cf3a1afa398ac9392a044de"], ["image", $file]); $curl->setopt(CURLOPT_URL, "http://imgur.com/api/upload.xml"); $curl->setopt(CURLOPT_HTTPPOST, \@values); print "Return: ", $curl->perform, "\n"; print "Error: ", $curl->errbuff, "\n";