hesco has asked for the wisdom of the Perl Monks concerning the following question:

This code:

#!/perl -T use strict; use warnings; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); my $baseurl = ''; my $authenticate = 'sd/agent/authentication/sd'; my $args = '?sd_username=admin&sd_password=canttellyou&CallerID=770250 +5192&Extension=21'; my $url = $baseurl . $authenticate . $args; $agent->get( $url );
is throwing this error:

Error GETing +sd?sd_username=admin&sd_password=canttellyou&CallerID=7702505192&Exte +nsion=21: Not Found at t/99-test_remotely.t line 28
This script (hitting that url) works just fine from my sandbox, but when I run it on to the development server which hosts this domain, it complains to me as described above. On that server, /etc/hosts includes:
and DNS knows that the domain points to the CNAME for my development server, or at least the IP for the router on the edge of its network (which is port-forwarding the requests in to the network, judging from tests from remote boxes).

SuperSearch says nothing, google nothing useful (at least on the first couple of pages of results). I've never seen this error before and can find nothing about it perldoc for either WWW::Mechanize nor that for LWP.

Digging through the code it seems to come from $mech->_update_page(), which includes this:

if ( $res->is_error ) { if ( $self->{autocheck} ) { $self->die( 'Error ', $request->method, 'ing ', $request-> +uri, ': ', $res->message ); } }
So as for my questions: What is this about? What does it mean? Why doesn't this work when run on the development server? What's it all about? Is this just a game we play?

Well those last two may be perhaps beyond the scope of this forum, but any ideas on the former three would certainly be appreciated.

-- Hugh


My appreciation to the Anonymous Monk who pointed out the debug options I had sought but missed. (I'd urge the maintainer of LWP and perhaps even WWW::Mechanize to include that references in the 'See also' section of their perldoc).

And my appreciation as well to ikegami, who pointed out the 404 error before the debug output could. This issue was very easily resolved by replicating a stanza in my apache configuration so that my sd. subdomain got answered at, in addition to its external private IP.

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }