Path: utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!utah-gr!stride!mitch From: mitch@Stride.COM (Thomas Mitchell) Newsgroups: comp.sources.d Subject: Re: Using perl without "#!" Message-ID: <717@stride.Stride.COM> Date: 17 Feb 88 19:40:36 GMT References: <184@ateng.UUCP> <1291@devvax.JPL.NASA.GOV> <1150@ucsfcca.ucsf.edu> Reply-To: mitch@stride.stride.com.UUCP (Thomas Mitchell) Organization: MicroSage, 680 S. Rock Blvd, Reno, NV 89502 Lines: 28 Summary: Define an environment variable In article <1150@ucsfcca.ucsf.edu> root@cca.ucsf.edu (Computer Center) writes: >In article <1291@devvax.JPL.NASA.GOV>, lwall@devvax.JPL.NASA.GOV (Larry Wall) writes: >> The answer is that I want people to be able to write somewhat >> portable perl scripts. I intended that you should always be able to get >> to /bin/perl on any machine, even it is just a symbolic link to where the >> real perl is stored. >Trying to lock non-standard programs into /bin is a typical hacker's >mistake. Even a program as fine as perl is said to be doesn't belong >in /bin. I agree -- programs which are 'locked' in to any given path are death. My preference for a default is "/usr/local" and "/usr/local/lib" as Larry Wall suggests. But go one step further. Select unique environment variables (perhaps: $PERLHOME, $PERLPATH, $PERLOPTS) test for them and use them if present to define the location of the binary ($PERLHOME) and if useful a path ($PERLPATH) to find libraries. $PERLOPTS can be used to pass the equivalent of command line options. This is not excessively difficult to code and can add much to portability. In this way only 'perl' need be found by $PATH 'perl' can be a shell script which checks for these environment variables and can set them and then exec $PERLHOME/PERL arg_list to load the real binary. OH Yes -- document them as well :-)