webb315 has asked for the wisdom of the Perl Monks concerning the following question:

I m new to perl only know basics. but can any one help me with this CURL? I have this php curl.. want to change it to perl.. PHP Code:
function curl($a,$b,$c,$d,$e){ $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $a, CURLOPT_RETURNTRANSFER => $b, CURLOPT_COOKIE => $c, CURLOPT_HEADER => $d, CURLOPT_NOBODY => $d, CURLOPT_CUSTOMREQUEST => ($e)?"POST":"GET", CURLOPT_POSTFIELDS => $e ) ); $g = curl_exec($ch); curl_close($ch); return $g; }
Any little help will also b appretiated!

Replies are listed 'Best First'.
Re: Help with curl...
by Corion (Patriarch) on Jul 12, 2008 at 15:41 UTC

    Maybe you can tell us where you are having problems. From reading the documentation, it seems that WWW::Curl pretty much has the functions you need. But it might well be that you'll be better off by using WWW::Mechanize, depending on your unstated needs.

Re: Help with curl...
by jettero (Monsignor) on Jul 12, 2008 at 15:23 UTC
    I think you'll find WWW::Mechanize does everything you need. I don't personally know any php or the curl commands it uses.

    -Paul

Re: Help with curl...
by swampyankee (Parson) on Jul 12, 2008 at 15:18 UTC

    As in  ×V? I'm sure there's a CPAN module for that...


    Information about American English usage here and here. Floating point issues? Please read this before posting. — emc