#! problems

Randal L. Schwartz merlyn at iwarp.intel.com
Fri Mar 29 07:55:44 AEST 1991


In article <4723 at cocoa7.UUCP>, protofan at motcid (Mike S. Protofanousis) writes:
| What do I need to do so that I don't have to type 'perl script' to run
| my perl script?  No, I don't want to use an alias.

This is on the manpage, as well as being (at least twice) in The Book.
Put:

      eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
      & eval 'exec /usr/bin/perl -S $0 $argv:q'
            if 0;

at the beginning of your program.  Be sure to make the file executable
(chmod +x filename).

print "Just another Perl hacker,"
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/



More information about the Comp.unix.questions mailing list