thewebsi has asked for the wisdom of the Perl Monks concerning the following question:
Is there an "elegant" way to get the current URL (including the Query String)?
I've been using this:
$ENV{QUERY_STRING} =~ s/(['"])/uc sprintf("%%%02x",ord($1))/eg; my $url = join ( "?", CGI::url ( -absolute => 1 ) || "/", $ENV{QUERY_S +TRING} || () );
I would have liked to use CGI::url ( -absolute => 1, -query_string => 1 ) but this returns the POSTed params instead of the Query String.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get current URL with Query String
by Your Mother (Archbishop) on May 10, 2013 at 16:51 UTC | |
by thewebsi (Scribe) on May 10, 2013 at 20:06 UTC | |
by techdex (Initiate) on Feb 04, 2014 at 06:26 UTC | |
by Your Mother (Archbishop) on Feb 04, 2014 at 15:30 UTC | |
|
Re: How to get current URL with Query String
by põhjapõder (Novice) on May 10, 2013 at 12:58 UTC | |
|
Re: How to get current URL with Query String
by Anonymous Monk on May 15, 2017 at 12:18 UTC |