in reply to Determining foreign port number

You can probably determine this from one of the environment variables stored in %ENV. For example, apache stores it in $ENV{'SERVER_PORT'}

Use this script to print the environment of a CGI request:

use strict; use CGI qw(:standard); print header, start_html; for my $k (sort keys %ENV) { print "$k = $ENV{$k}<br>"; } print end_html;

HTH, HAND.