Home > Archive > PERL Programming > November 2005 > cannot run the perl script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
cannot run the perl script
|
|
| bander8989 2005-11-19, 3:56 am |
| > Hi
>
> I tried to run a simple perl script ./test.pl under /var/www or
/var/www/cgi-bin, but no output showed
> while i can run it under / without any problem
> the permission of file is
> [root@server cgi-bin]# ls -l test.pl
> -rwxrwxrwx 1 root root 92 Nov 7 19:52 test.pl
>
> if i run it like this ./test.pl no output, but if i run it perl
test.pl it will show me the output
>
> root@server cgi-bin]# ./test.pl
> [root@server cgi-bin]# perl test.pl
> hello
> /var/www/cgi-bin
> [root@server cgi-bin]#
>
>
> if i tried it again and run it under / directory it will run without
any problem
>
>
> [root@server /]# ./test.pl
> hello
> /
>
> [root@server /]# perl test.pl
> hello
> /
>
> [root@server /]#
>
> script content:
>
> [root@server /]# cat test.pl
> #!/usr/bin/perl -w
> print "hello\n";
> print `/bin/pwd` or die "can't run pwd\n";
> print "\n";
> [root@server /]#
>
Sent via Archivaty.com
| |
|
| In article <i8SdnSyMOed_bePeRVn-qQ@giganews.com>, bander8989 says...[color=darkred]
>
>/var/www/cgi-bin, but no output showed
>test.pl it will show me the output
>any problem
You might need to adjust your path to Perl in your test.pl file. Need to check
your installation, but as an example if your Perl was installed in
"/usr/local/bin/" you may need to change
#!/usr/bin/perl -w
to...
#!/usr/local/bin/perl -w
in your test.pl file.
Ken
--
Basic Newsguy - 3 GB / month - $39.95 / year
http://newsguy.com/overview.htm
|
|
|
|
|