sub hitFbNew { my ($method, $endpoint, $form) = (shift, shift, shift); my $curl = WWW::Curl::Easy->new; my $curlf = WWW::Curl::Form->new; my $response_body; for my $key (keys %{$form}){ $curlf->formadd($key, $form->{$key}); } $curl->setopt(CURLOPT_WRITEDATA, \$response_body); $curl->setopt(CURLOPT_URL, $endpoint); $curl->setopt(CURLOPT_HTTPPOST, $curlf); print "\nHitting FB using the curl libraries..."; my $response = $curl->perform; print "\nresponse was $response"; my %reply = ( content => $response_body, responseCode => $curl->getinfo(CURLINFO_HTTP_CODE) ); print "\nreply code is $reply{responseCode} and content is $reply{content}"; return (\%reply); }