Perl Std->href formatting

1.4k views Asked by At

I've been asked to hard code a link so that some search parameters default to a 365 day time range.

In perl I'm using the Std->href(url) to generate the url.

My question is:

I need to add the following to the url to default to this time range: eventDateOption=365#orderAscending=

but whenever I add it the # tag gets replaced with %23, etc. I'm wondering if there is a way to make it so this replacement doesn't happen.

2

There are 2 answers

0
Ilion On

The pound sign (#) is a special character in URLs to denote anchors within a page. Your value is being URL encoded so that it does not get confused with this and the script that is processing the link should be able to url decode the value and then interpret the %23 as a #.

0
SirSpammenot On

So... you are saying %23 doesn't work in the browser? :)

I think you may want to use the Ampersand, or "&" character, instead to separate parameters.

See: http://en.wikipedia.org/wiki/Query_string