PDA

View Full Version : Perl Script problem II



homeflash
01-30-2003, 10:22 AM
I am trying to run Helloworld.pl

All I got is from dos prompt

Content-Type: text/html

<html><HEAD><TITLE>Hello World</TITLE></HEAD><BODY><H2>Hello World</H2></BODY></html>

I thought I was supposed to get in in the web page?

How do I fix it...?? thanks in advance

*** Sometimes Helping is a way of Learning! ***

adamdelves
01-31-2003, 01:37 AM
Hi I wasn't sure what thread to reply to. I'm gonna do the best I can but I don't have and have never used the Windows 98 Personal web server so I may not be of much help.

Basically the webserver needs to be told that when ever you request a file with the extension .pl you want it to be parsed by the exe for perl. I have done some research and this can be done by creating a registry value.

Goto:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\W3Svc\Parameters\ScriptMap\]

Now create a string value with the name of the extension you want perl scripts to be executed with. In this case its .pl. Set this value to the path of your perl interpreter. I had a look on perl.com and I think this is what it should be:

C:\MyPerl\perl.exe -S

Now you've got to restart the Web Server and then navigate to the page. If the name of you webserver is localhost and you have a perl script called hello_world.pl in your root folder then this is what you would type into the web browser address bar:

http://localhost/hello_world.pl

Provided I have given you the correct switch to invoke perl.exe it should work. This is the article I got the information from <a target="_blank" href=http://www.perldoc.com/perl5.6/pod/perlrun.html>www.perldoc.com/perl5.6/pod/perlrun.html</a>. I hope this was of some use.

homeflash
01-31-2003, 08:05 AM
Hi Adamdelves

Thank you so much.. it seems to work now...

However, there is a slight problem..
Some of my cgi scripts that I downloaded still shows content-type: text/html. If I used the default developer's cgi, then it is fine, if I used mine, then I would get that error. But for now, I am glad at least my pl works for my browser.

I will take a look at the more pl and cgi script and see if i can one of them actually working..

At least my hello.pl is working now..

Thanks again...



*** Sometimes Helping is a way of Learning! ***