Subject: | Synopsis code has a bug |
Subject: SimpleHTTP server exits with error on rapid reloads
With a simple server built from the synopsis code, the error
Show quoted text
> Use of uninitialized value in concatenation (.) or string at SMSCenter.pl line 89.
[my source line number]
occurs. I traced it to this code:
sub GOT_ERR { ...
# Do our stuff to HTTP::Response
$response->code( 404 );
$response->content( "Hi visitor from " . $request->connection-
Show quoted text>remote_ip . ", Page not found -> '" .
^^^^^^^^^^
where it turns out that the "remote_ip" reference does not exist. I changed it to
read:
$response->content( "Hi visitor from " . $request->connection-
Show quoted text>{'Remote_IP'} . ...
and it worked.