in reply to CGI::Carp fatalsToFile
You could try putting this at the top of the script:
This will change the server's response code from 500 to 200 and would give you content like:use CGI::Carp qw(set_die_handler); BEGIN { sub handle_errors { my $msg = shift; print "Content-Type: text/html\n\n"; print "$msg"; } set_die_handler(\&handle_errors); }
However, the fact that the script you are calling with LWP::Simple does not appear in the logs would suggest that it is not actually being called.[Wed Oct 5 23:53:36 2021] test.cgi: Died at /web/test.cgi line 15.
I would not discount the role of user-agent - non-standard user-agents can be blocked to prevent web scraping. Maybe something at the server level was updated or reconfigured by your hosting company? To test you will need to use LWP::UserAgent directly.
use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent('Mozilla/5.0'); # play with this string my $response = $ua->get('http://localhost/web/test.cgi'); if ($response->is_success) { print $response->decoded_content; } else { print $response->status_line; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: CGI::Carp fatalsToFile
by Bod (Parson) on Oct 06, 2021 at 16:25 UTC | |
by tangent (Parson) on Oct 06, 2021 at 17:34 UTC |
In Section
Seekers of Perl Wisdom