PDA

View Full Version : New question! PERL script doesn't execute




digital1
Dec 6, 2005, 10:32 PM
Ok! I have another question.I couldnt find my other post so I will post another another thread. What happens is that I have a perl module and script. The Perl script doesn't execute in the cgi-bin, but outside of cgi-bin it executes.Permissions on the perl script are 755. I am really confused and no one knows how to help me. Any suggestions?



jeremy.king
Dec 7, 2005, 09:28 AM
How are you trying to execute them? Through a web browser request or from the command line? If its from a web browser, check that your apache http server is configured correctly...

digital1
Dec 7, 2005, 09:29 AM
How are you trying to execute them? Through a web browser request or from the command line? If its from a web browser, check that your apache http server is configured correctly...


I am trying to execute it from command line. Its a driver test script to test a module in the same directory. Thanks :-)

jeremy.king
Dec 7, 2005, 09:31 AM
Ok - what error is it giving exactly? The directory shouldn't matter if you are executing from command line, unless you have specific relative paths in your script. weird....

digital1
Dec 7, 2005, 11:53 AM
Ok - what error is it giving exactly? The directory shouldn't matter if you are executing from command line, unless you have specific relative paths in your script. weird....

It doesn't give an error. When I go to command line to execute the script, it acts like its going to execute but doesn't. So for example:

[user@someserver]: ./this_is_the_script.pl

[user@someserver]: {nothing would be here, just blinking cursor}

jeremy.king
Dec 7, 2005, 12:03 PM
have you tried doing a perl this_is_the_script.pl

digital1
Dec 7, 2005, 12:25 PM
have you tried doing a perl this_is_the_script.pl

Yes I have and it works. The problem is, is that this script is just a driver to test if a local perl module works. The problem is, is that I cannot store the output of the work of the Perl module in the local script so I can manipulate it. The test script just outputs whats stored in the variable of the script.It seems outside of the cgi-bin, I can get to the data that the perl module collects and store it locally within the memory space of the current running script, but within the cgi-bin, it just shows nothing.

jeremy.king
Dec 7, 2005, 12:39 PM
Yes I have and it works.

For clarity, this works both inside and outside of your cgi-bin directory? If it does indeed work both in and out, then this usually indicates a problem with permissions or the compiler declarations on the first line.

Also, if you want to take this discussion outside of your thread, I would be willing to ssh/telnet in to see if we can figure this out. If you want PM me a servername/login/pass to use.

digital1
Dec 7, 2005, 12:49 PM
For clarity, this works both inside and outside of your cgi-bin directory? If it does indeed work both in and out, then this usually indicates a problem with permissions or the compiler declarations on the first line.

Also, if you want to take this discussion outside of your thread, I would be willing to ssh/telnet in to see if we can figure this out. If you want PM me a servername/login/pass to use.


When I run it as 'perl this_script.pl' inside and outside of cgi-bin, it works. But when I run it as ./this_script.pl or this_script.pl inside cgi-bin, it does not work. I don't know if the professor would let me add another user to the server, when I don't have rights to do that myself :) Thanks though for ALL the help and suggestions.

digital1
Dec 7, 2005, 12:52 PM
When I run it as 'perl this_script.pl' inside and outside of cgi-bin, it works. But when I run it as ./this_script.pl or this_script.pl inside cgi-bin, it does not work. I don't know if the professor would let me add another user to the server, when I don't have rights to do that myself :) Thanks though for ALL the help and suggestions.


I could email you the scripts so you can run through them quick though...

jeremy.king
Dec 7, 2005, 01:12 PM
I could email you the scripts so you can run through them quick though...

that may work.

Like I mentioned before, if the perl command works but the . command doesn't its usually indicative of permissions or declarative problems.

PS. Let your prof know that I am a local. I work in Glendale :)

kingjr3@yahoo*SPAMDAMMYDO].com

superbovine
Dec 7, 2005, 10:58 PM
chmod 777

digital1
Dec 8, 2005, 07:10 AM
chmod 777

Have tried that already on the file and the folder.

sreedy
Dec 8, 2005, 07:43 AM
Is this not an issue with your sh-bang statement on the first line:

do a 'which perl'

sreedy$ which perl
/usr/bin/perl

and check that you've got #!/usr/bin/perl as the first line in your script.

That's my best guess after reading this thread.

my $0.02

digital1
Dec 8, 2005, 09:51 AM
Is this not an issue with your sh-bang statement on the first line:

do a 'which perl'

sreedy$ which perl
/usr/bin/perl

and check that you've got #!/usr/bin/perl as the first line in your script.

That's my best guess after reading this thread.

my $0.02


Everything matches up. Still no go. :( Thanks for the response though.