in reply to Include js files in Perl-CGI

You need to make a difference between your local file system and URLs.

Probably you want to use
<script type='text/javascript' src='/JS/AnchorPosition.js' language='javascript' type='text/javascript'></script>