First, check the obvious:
- type the link in manually, copy it and paste to a text editor
- right click on link that fails and copy 'Link Location'/'Shortcut' or whatever your browser calls it. Paste this in the text editor underneath the other link.
If they are the same, the only thing i can think of is if your script performs some action based on the $ENV{'HTTP_REFERER'} environment variable, and when a referer exists, the script dies nastily at some point.
So have a play, use CGI::Carp and see what happens...
cLive ;-)