Networking :: perl not working



My PERL scripts which read stuff out of a text file execute in the browser but will not read the text file. It will read the text file in the command line. Can someone please help me?
moo_cow22000, I don't know if this helps you but here is a simple example.  First create the file below in beaver and call it /home/dsl/test.txt

Code Sample
one
two
three
four


Then create the file below in beaver and save it to /home/dsl/tut.pl

Code Sample
#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "Test Page start<P>\n";

$myFile = '/home/dsl/test.txt';
open(MYFILE,$myFile);
@myLines = <MYFILE>;
close(MYFILE);
print @myLines;
print "<br>Test page end\n";


Change the permission using chmod 755 /home/dsl/tut.pl

Run these commands to copy that file to /opt/monkey/cgi-bin with the correct permissions:
sudo cp /home/dsl/tut.pl /opt/monkey/cgi-bin/tut.pl
sudo chown root /opt/monkey/cgi-bin/tut.pl
sudo chgrp staff /opt/monkey/cgi-bin/tut.pl


Fire up monkey using the right click menu and choosing System->Daemons->Monkey Web Server->monkey start.  Now try to run tut.pl in the command line and as a web page and it should work:

/home/dsl/tut.pl
dillo 127.0.0.1/cgi-bin/tut.pl

I just found apache in the myDSL thing and got that running and it runs my perl scripts fine. Thanks for your help anyway.

original here.