in reply to Re: undefined value as filehandle from Curl.pm
in thread undefined value as filehandle from Curl.pm

The open() you refer to is not in my code, it's in the perl module. I agree the success/failure of the open() should be tested.

Replies are listed 'Best First'.
Re^3: undefined value as filehandle from Curl.pm
by wanderedinn (Sexton) on Jun 29, 2016 at 14:20 UTC

    So, here is an oddity. If I remove the following line:

    $lwpcurl->{agent}->setopt( CURLOPT_HEADERDATA, ['Content-Type:text/xml +'] );

    The error:

    Can't use an undefined value as filehandle reference at /home/mware/httppost/lib/perl5/site_perl/5.8.8/LWP/Curl.pm line 236.

    Goes away.

    Although, the http post still does not work properly. I'm not seeing my test file on the server. I have a curl command line test that works correctly, but can not seem to configure the perl code to do the same.

      I have determined why this error was caused in this code. That is because the parameter I am attempting to use, expects a pointer to a file, file handle, rather than a string as I was attempting. Hence the reason for the filehandle error. Thought I'd post an update for others who might attempt to use this module.