Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script will not be executed without the -w flag ?!

Status
Not open for further replies.

shlomyb

Programmer
Nov 14, 2006
32
IL
Hi guys

I have a script named "a.pl"

1.I can NOT execute it with the following command : perl a.pl
and I get the following command :" bad interpreter: No such file or directory"

2.But CAN with : perl -w a.pl

I use a linux machine and verified by a "which perl" command the perl path (/usr/bin/perl)

 
I've seen the shebang line coded as
Code:
#!/usr/bin/perl -w
before, but I don't know if it has any effect. Then you might be able to
Code:
./a.pl
as mbrooks suggests?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
I've had website hosting on linux servers, and one of them required the "-w" switch on the shebang line, otherwise we'd get a 500 Internal Server Error.

So the first line of code had to look like this:
Code:
#!/usr/bin/perl -w

Because without the -w, the code wouldn't run.

-------------
Cuvou.com | The NEW Kirsle.net
 
Hi Kirsle ,
Where it can be defined that perl script will run only when particular switch is used?


--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top