HELP: Automatic Execution of perl scripts RE: first line of code #!/usr/bin/perl/ 
Author Message
 HELP: Automatic Execution of perl scripts RE: first line of code #!/usr/bin/perl/

How do I envolke automatic recognition of the first line of code in a
perl script on a UNIX Server?

                                i.e.    #!/usr/bin/perl

This works:                     perl <perl.executable>

This doesn't work:              <perl.executable>

The perl interpretor is located in      /usr/bin    and this directory
is in my path.

Richard Keeler



Fri, 17 Apr 1998 03:00:00 GMT  
 HELP: Automatic Execution of perl scripts RE: first line of code #!/usr/bin/perl/

: How do I envolke automatic recognition of the first line of code in a
: perl script on a UNIX Server?
:                               i.e.    #!/usr/bin/perl
: This works:                   perl <perl.executable>
: This doesn't work:            <perl.executable>
: The perl interpretor is located in    /usr/bin    and this directory
: is in my path.

Make sure that the permissions on the perl.executable are set correctly, ie
chmod 755 perl.executable.

--

Nick


            St. John's College, Cambridge, CB2 1TP.   0973 614210
         15 Knoll Close, Littleover, Derby, DE23 7SG.   01332 516351
         "My socks and shoes always match - is it luck?"  -  Primus



Sat, 18 Apr 1998 03:00:00 GMT  
 HELP: Automatic Execution of perl scripts RE: first line of code #!/usr/bin/perl/

Quote:
>How do I envolke automatic recognition of the first line of code in a
>perl script on a UNIX Server?
>                            i.e.    #!/usr/bin/perl
>This works:                 perl <perl.executable>
>This doesn't work:          <perl.executable>
>The perl interpretor is located in  /usr/bin    and this directory
>is in my path.

Yes but is the perl script in your path?  UNIX does not automatically
look for executeables in the current directory like DOS does.  You
have to specifically include the script directory or a dot (.) in your
path for the current directory.

Also when you change your path you may need to rehash if using csh
(see 'man rehash').

perl scripts do not seem to work on our system unless we do the emacs
thing (even though I have never used emacs) as in:

#!/usr/bin/perl -- -*-perl-*-
(that is space, dash, dash, space, -*-perl-*-)

David Efflandt/Elgin, IL USA



Sun, 19 Apr 1998 03:00:00 GMT  
 HELP: Automatic Execution of perl scripts RE: first line of code #!/usr/bin/perl/
1) Check the execuable perl PATH : Do
which perl
2) Check rights on the file :
chmod a+rx executable.perl

Good luck!
--

                                                           ,,,
                                                          (. .)
_______________________________________________________ooO-(_)-Ooo______
Hussein SALEM                                   |
Banterveste 6                                   |
3432 BC Nieuwegein                              |
Netherlands                                     | "One day, I'll do it"      
Tel : (31) 3402 53725 (Home)                    |
Tel : (31) 3402 88719 (Work)                    |       Coco-Wawa


______________________________________________________________Oooo._____
                                                     .oooO    (   )
                                                     (   )     ) /
                                                      \ (     (_/
                                                       \_)



Tue, 21 Apr 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. /usr/bin/perl vs /usr/local/bin/perl

2. #!/usr/local/bin/perl -w || /usr/bin/perl -w

3. #!usr/local/bin/perl line in IIS for a script example

4. 5.005 in /usr/bin and 5.6.0 in /usr/local/bin

5. HELP: #!/usr/bin/perl net being pased properly

6. chsh /usr/bin/perl [writing a shell in perl]

7. #!/usr/bin/perl to #!perl

8. NT-Perl - No "#!/usr/bin/perl"

9. NT-Perl - No "#!/usr/bin/perl"

10. perl not always in /usr/bin/perl

11. why perl -nw not #/usr/bin/perl -nw

12. #!/usr/bin/perl AND #!/usr/local/bin/perl both posible?

 

 
Powered by phpBB® Forum Software