Perl generated javascript

software development

#1

I have a perl cgi that is symbolically linked as:
mkrandomhome.js -> mkrandomhome.pl
I use it in my index.html file as:

This perl generates javascript with a list of all of my images on the site and a function to randomly select an image. It does not work on the test, though:
http://rrkphoto.dreamhosters.com/

If I run the perl on the command line and save that as mkrandomhome.js, it works fine.

This works on godaddy and in the past when I hosted my own domain, so I am at a loss as to why it is not working now. Any ideas?


#2

I fixed it! I just needed to rename the script .pl. As in:


#3

The reason for that… the web server analyzes extensions and decides what to do with them *.pl => cgi, etc, etc. Else you would have had to change your .htaccess to tell it to run thatfile.js as a cgi.