1 ?RCS: $Id: startperl.U,v 3.0 1993/08/18 12:09:50 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: This file is included with or a derivative work of a file included
6 ?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
7 ?RCS: In accordance with clause 7 of dist's modified Artistic License:
9 ?RCS: You may distribute under the terms of either the GNU General Public
10 ?RCS: License or the Artistic License, as specified in the README file.
12 ?RCS: $Log: startperl.U,v $
13 ?RCS: Perl5 version -- I always have d_portable=define.
15 ?RCS: Revision 3.0 1993/08/18 12:09:50 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
18 ?MAKE:startperl: cat Myread sharpbang binexp test versiononly version
19 ?MAKE: -pick add $@ %<
21 ?X: This is different from dist's standard startperl.U unit because
22 ?X: we can't directly test #!/usr/local/bin/perl (or whatever) because
23 ?X: we haven't built and installed perl yet.
25 ?S: This variable contains the string to put on the front of a perl
26 ?S: script to make sure (hopefully) that it runs with perl and not some
27 ?S: shell. Of course, that leading line must be followed by the classical
29 ?S: eval 'exec perl -S $0 ${1+"$@"}'
30 ?S: if $running_under_some_shell;
31 ?S: to guarantee perl startup should the shell execute the script. Note
32 ?S: that this magic incatation is not understood by csh.
35 ?C: This variable contains the string to put in front of a perl
36 ?C: script to make sure (one hopes) that it runs with perl and not
39 ?H:#define STARTPERL "$startperl" /**/
41 : figure out how to guarantee perl startup
48 I can use the #! construct to start perl on your system. This will
49 make startup of perl scripts faster, but may cause problems if you
50 want to share those scripts and perl is not in a standard place
51 ($binexp/perl) on all your platforms. The alternative is to force
52 a shell by starting the script with a single ':' character.
55 case "$versiononly" in
56 "$define") dflt="$binexp/perl$version";;
57 *) dflt="$binexp/perl";;
59 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
62 none) startperl=": # use perl";;
64 if $test 30 -lt `echo "$ans" | wc -c`; then
67 WARNING: Some systems limit the #! command to 32 characters.
68 If you experience difficulty running Perl scripts with #!, try
69 installing Perl in a directory with a shorter pathname.
75 *) startperl=": # use perl"
80 echo "I'll use $startperl to start perl scripts."