http://www.perlmonks.org?node_id=371195


in reply to Rebuilding GET Parameters without ENV{'REQUEST_URI'}

Thank you both! That worked perfectly. Here's the final line that works for both Apache and IIS servers:
my $url = self_url; # get the url from CGI