astro-pilot has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to get a refer url on script url, both of which have a hash mark or pound symbol (#) in the url (an HTML anchor). Of course perl ignores the hash mark and everything else behind it and my attempts to use CGI.pm and envrionmental variables to do it have failed. Any suggestions on how to obtain the full url including the html anchor? I could use a onclick javascript function to pass the info when a user hits a link, but if someone puts the url with the anchor into the browser themselves, then the script will not properly execute and take the user to the correct spot. I need some help. ap

Replies are listed 'Best First'.
Re: GET full url that contains hash mark
by friedo (Prior) on Sep 11, 2005 at 04:27 UTC
    The problem is not that Perl or CGI ignores the # anchor, the problem is that the browser does not send the anchor data to your server in the first place. A Javascript function might work for clicked links, but I can't think of any way to capture that information for a pasted link.
Re: GET full url that contains hash mark
by saintmike (Vicar) on Sep 11, 2005 at 04:28 UTC
      Thanks for the link, although not the greatest of news. I guess I can stop trying.
      ap
Re: GET full url that contains hash mark
by Cody Pendant (Prior) on Sep 11, 2005 at 04:30 UTC
    Of course perl ignores the hash mark and everything else behind it

    What do you mean by "perl" in that sentence? "Perl" doesn't get URLs for you, so you must be using a module of some kind?



    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print