If your script uses CGI.pm (many well-written CGI scripts do) you can use the
$q->url() method to get the script's actual URL in any number of formats (relative, full, etc.).
The $q->self_url() method will even generate a self-referencing URL that will maintain state.
Dave
"If I had my life to live over again, I'd be a plumber." -- Albert Einstein