<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

#########################
## getIP.pl - Save the IP address of the requester
#########################

use strict 'refs';

$remoteAddress = $ENV{REMOTE_ADDR};

#
# This saves a file on the server that contains just the IP address,
#  just for shits and giggles.
#
open ( OUTFILE, "&gt;homeIP.txt" );
print OUTFILE $remoteAddress;
close OUTFILE;

#
# This file contains an HTML anchor that points to the application
# on my home server.
#
open ( OUTFILE, "&gt;appname.html" );
print OUTFILE "&lt;A HREF=\"http://$remoteAddress/appname\"&gt;My Application&lt;/A&gt;";
close OUTFILE;

#
# This file has an HTML anchor that points to the same application
# on my home server.  But this time over SSL (port 443)
#
open ( OUTFILE, "&gt;secure_app.html" );
print OUTFILE "&lt;A HREF=\"https://$remoteAddress/appname\"&gt;My App(secure)&lt;/A&gt;";
close OUTFILE;

#
# This file has an HTML anchor that points to a second application that I use.
#
open ( OUTFILE, "&gt;secondApp.html" );
print OUTFILE "&lt;A HREF=\"http://$remoteAddress/secondApp\"&gt;Second App&lt;/A&gt;";
close OUTFILE;

#
#  A static web page on the home server
#
open ( OUTFILE, "&gt;page.html" );
print OUTFILE "&lt;A HREF=\"http://$remoteAddress/page.html\"&gt;Static Page&lt;/A&gt;";
close OUTFILE;
</pre></body></html>