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->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->{'Remote_IP'} . ...
and it worked.