Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
You could try putting this at the top of the script:
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); }
This will change the server's response code from 500 to 200 and would give you content like:
[Wed Oct 5 23:53:36 2021] test.cgi: Died at /web/test.cgi line 15.
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.

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; }

In reply to Re: CGI::Carp fatalsToFile by tangent
in thread CGI::Carp fatalsToFile by Bod

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2022-05-27 13:16 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (95 votes). Check out past polls.