Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: CGI::Carp fatalsToFile

by Bod (Parson)
on Oct 08, 2021 at 18:29 UTC ( [id://11137364]=note: print w/replies, xml ) Need Help??


in reply to Re: CGI::Carp fatalsToFile
in thread CGI::Carp fatalsToFile

Since it's not https-related, you're probably back to wanting a fatalsToFile equivalent

It turns out that it is https-related...

There were two red herrings.
Firstly the .htaccess uses a 301 redirect that was being cached and also the getstore method of LWP::Simple is not doing what I expected.

my $availability; my $response = LWP::Simple::getstore("http://$ENV{'HTTP_HOST'}/cgi-bin +/booking.pl?command=check&st=$data{'st'}&ed=$data{'ed'}&force=$data{' +force'}", $availability); print "->$availability<-\n"; print "$response\n";
Shows $availability as empty even though the server is responding with 200 code.

So, now I know that it is an HTTPS issue, I need to find a way to fix it...

Replies are listed 'Best First'.
Re^3: CGI::Carp fatalsToFile
by pryrt (Abbot) on Oct 08, 2021 at 18:36 UTC
    Are you sure you're using getstore correctly? Per the LWP::Simple docs:

    getstore

    my $code = getstore($url, $file)

    Gets a document identified by a URL and stores it in the file. The return value is the HTTP response code.

    getstore desires a URL and a filename. Your code snippet shows $availability as being undefined.

      Are you sure you're using getstore correctly?

      No - I had read it as storing the document in a variable, not a file...

        per the example in the test suite, it's used as a file name: get.t#L62

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-28 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found