=item 2.
Contained in the file specified by the first filename on the command line.
-(Note that systems supporting the #! notation invoke interpreters this way.)
+(Note that systems supporting the #! notation invoke interpreters this
+way. See L<Location of Perl>.)
=item 3.
if you were so inclined, say
#!/bin/sh -- # -*- perl -*- -p
- eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+ eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}'
if $running_under_some_shell;
to let Perl see the B<-p> switch.
There is no general solution to all of this. It's just a mess.
+=head2 Location of Perl
+
+It may seem obvious to say, but Perl is useful only when users can
+easily find it. When possible, it's good for both B</usr/bin/perl> and
+B</usr/local/bin/perl> to be symlinks to the actual binary. If that
+can't be done, system administrators are strongly encouraged to put
+(symlinks to) perl and its accompanying utilities, such as perldoc, into
+a directory typically found along a user's PATH, or in another obvious
+and convenient place.
+
+In this documentation, C<#!/usr/bin/perl> on the first line of the script
+will stand in for whatever method works on your system.
+
=head2 Switches
A single-character switch may be combined with the following switch, if
the selected filehandle. Note that STDOUT is restored as the
default output filehandle after the loop.
-You can use C<eof> without parenthesis to locate the end of each input file,
+You can use C<eof> without parentheses to locate the end of each input file,
in case you want to append to each file, or reset line numbering (see
example in L<perlfunc/eof>).
of those suffixes. If your Perl was compiled with DEBUGGING turned
on, using the -Dp switch to Perl shows how the search progresses.
-If the file supplied contains directory separators (i.e. it is an
+If the filename supplied contains directory separators (i.e. it is an
absolute or relative pathname), and if the file is not found,
platforms that append file extensions will do so and try to look
for the file with those extensions added, one by one.
have a shell compatible with Bourne shell:
#!/usr/bin/perl
- eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+ eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}'
if $running_under_some_shell;
The system ignores the first line and feeds the script to /bin/sh,
contain the full pathname, so the B<-S> tells Perl to search for the
script if necessary. After Perl locates the script, it parses the
lines and ignores them because the variable $running_under_some_shell
-is never true. A better construct than C<$*> would be C<${1+"$@"}>, which
-handles embedded spaces and such in the filenames, but doesn't work if
-the script is being interpreted by csh. To start up sh rather
+is never true. If the script will be interpreted by csh, you will need
+to replace C<${1+"$@"}> with C<$*>, even though that doesn't understand
+embedded spaces (and such) in the argument list. To start up sh rather
than csh, some systems may have to replace the #! line with a line
containing just a colon, which will be politely ignored by Perl. Other
systems can't control that, and need a totally devious construct that
will work under any of csh, sh, or Perl, such as the following:
- eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
- & eval 'exec /usr/bin/perl -S $0 $argv:q'
+ eval '(exit $?0)' && eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}'
+ & eval 'exec /usr/bin/perl -wS $0 $argv:q'
if $running_under_some_shell;
=item B<-T>
-forces "taint" checks to be turned on so you can test them. Ordinarily these checks are
-done only when running setuid or setgid. It's a good idea to turn
-them on explicitly for programs run on another's behalf, such as CGI
-programs. See L<perlsec>.
+forces "taint" checks to be turned on so you can test them. Ordinarily
+these checks are done only when running setuid or setgid. It's a good
+idea to turn them on explicitly for programs run on another's behalf,
+such as CGI programs. See L<perlsec>. Note that (for security reasons)
+this option must be seen by Perl quite early; usually this means it must
+appear early on the command line or in the #! line (for systems which
+support that).
=item B<-u>
=item PERL_DEBUG_MSTATS
Relevant only if perl is compiled with the malloc included with the perl
-distribution (that is, if C<perl -V:d_mymalloc> is 'define'),
-if set, this causes memory statistics to be dumped after execution. If set
+distribution (that is, if C<perl -V:d_mymalloc> is 'define').
+If set, this causes memory statistics to be dumped after execution. If set
to an integer greater than one, also causes memory statistics to be dumped
after compilation.