I have recently written some code using WWW::Curl code to access a remote server and perform an HTTPS POST operation. The problem I encounter is when I try and retrieve the responses contents. I have a dev and a production server and have found that they require different code to do this.
My code on my production server is identical to the perldoc:
my $response_body; $curl->setopt(CURLOPT_WRITEDATA,\$response_body); print STDERR $response_body;
My code on my development server I found using a google search:
my $response_body = ""; open my $response_handle, '>', \$response_body; $curl->setopt(CURLOPT_WRITEDATA,\$response_handle); print STDERR $response_body;
If I run the production code on the dev server I get the error:"Can't use an undefined value as filehandle reference at ?????????.pm line 70.". Also if I try to use the dev code on the production server I get no error and an empty string.
Both servers are running perl 5.10.1, and the same version of WWW::Curl, both are CentOS 6.6, the only difference I have found is the dev is running a 3x series kernel and the production a 2x series kernel. Any insight into why the code is behaving differently, and protecting against it would be greatly appreciated.
Thanks
In reply to WWW::Curl code works on one server not another. by kernal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |