Click to See Complete Forum and Search --> : I wonder if #!perl will work...


pratik_learner
05-23-2005, 02:16 PM
Will #!perl will work instead of #perl/usr/perl/bin/ or whatever? I have a feeling that i've read it somewhere wanna verify? And one more thing any Free Perl 6 environment available that's more free of bugs than the rest?

Nedals
05-23-2005, 07:46 PM
#perl/usr/perl/bin/ ## That's really strange!!

#!/usr/bin/perl
In Linux/Unix, this is the path to the Perl interpreter. So basically, No!

Charles
05-23-2005, 07:52 PM
There's an old story about two professors, just at the end of the dark ages, discussing the number of teeth in a horse's mouth. They argued for hours saying things like, "It can't be a multiple of seven because that is the number which represents God." One of their students went outside, found a horse and counted the teeth.

For the script to run, the shebang must describe the location of the Perl interpreter. And you can be certain the the interpreter is right where the person who set up the server put it.

Ultimater
05-24-2005, 03:01 PM
Depending on your server, these are the two most commonly used headers:

#!/usr/bin/perl
#!/usr/local/bin/perl

You usually need to provide -w in addition like so:
#!/usr/bin/perl -w

usr, local, bin, and perl are all folder names -- if you could somehow rename one of the folders then you'd need to use a new unique header.
It would be possible to move the perl folder so your header would be as simple as:
#!/perl -w
But the only way that I know of to do this is to have physical access to the server rather than through the internet.