PDA

View Full Version : Perl Script problem (W98)



homeflash
01-28-2003, 07:24 AM
I have installed Perl 5.0 and I tried to run any cgi file and/or helloworld.pl. It does not work at all. For the simple HelloWorld.Pl, it simply returns to a dos message as follows


Content-Type: text/html
<html><Head><<Title>Hello World</Title></Head><BODY><h2>Hello World></H2></body</html>


How do I make it work...
Please help..

p.s. I uninstall and reinstall perl few times and no joy.
p.p.s It used to work, for some reason, it does not work any more...


thanks in advance


*** Sometimes Helping is a way of Learning! ***<P ID="edit"><FONT class="small">Edited by homeflash on 01/28/03 07:31.</FONT></P>

adamdelves
01-28-2003, 10:34 AM
What do you use perl for? Because I thought it was a server side scripting language so wouldn't you need a web server?

If you are using it for that purpose then the ouput is no doubt right as it is meant to appear in a web page. You only need down load a server like apache or use the Win 98 personal web server and configure it to execute files with .pl extensions with the perl parser.

I don't know perl but I use PHP which is also a server side scripting language.

homeflash
01-28-2003, 02:06 PM
I am using it for my webserver.

My perl script is working now (seems to be...still testing ) at least for the cgi script files, but for the pl file. It does not work at all.


Anyway, my main concern is to cgi file. I had part of it working.. I am still trying to see if it fully functions.
Is PHP also able to interpret CGI scripts???



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

adamdelves
01-28-2003, 03:19 PM
I wouldn't like to say to be honest. I know that php is made from lots of CGI programs, basically with the intention of creating an easy to learn CGI programming language.

I believe that PHP is a CGI program in its self. It can do everything perl can do but its easier. For exapmle the PHP script for hello world would be:
<pre>
&lt;?php
echo ('Hello World');
?&gt;
</pre>
You can also mix and match it with HTML which is one big advantage or using C or perl.
<pre>
&lt;html&gt;
&lt;body&gt;
&lt;?php for ($i=1;$i&lt;=6;$i++): ?&gt;
&lt;h&lt;?php echo($i) ?&gt;&gt;Today's date is &lt;?php echo (date ("m/d/Y")) ?&gt;&lt;/h&gt;&gt;
&lt;?php endfor; ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
Are you using apache or the Win 98 server? Cos i found when I used CGI/PHP with IIS it often crashed with 500 server errors for no apparent reason.

Theres a whole site on <a target="_blank" href=http://www.php.net>PHP</a> which can tell you a whole lot more than I can.

homeflash
01-28-2003, 03:34 PM
thanks I will take a look later... I am using win98 server...


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

homeflash
01-29-2003, 06:44 AM
I just went back to try my perl script programs. For some reason, it only works for cgi scripts, not pl script.

it said Unknown Content-type:

Do you know why??

The extension should be applied to my web server

Thanks for help in advance


*** Sometimes Helping is a way of Learning! ***<P ID="edit"><FONT class="small">Edited by homeflash on 01/29/03 06:44.</FONT></P>