Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

digital1

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
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

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
kingjr3 said:
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

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
kingjr3 said:
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}
 

digital1

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
kingjr3 said:
have you tried doing a
Code:
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

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
digital1 said:
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

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
kingjr3 said:
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

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
digital1 said:
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...
 

sreedy

macrumors 6502a
Feb 24, 2005
501
0
Somerset
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

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
sreedy said:
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.