X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlrun.pod;h=3170df4ccc50e78c1489e51abea59197a887143f;hb=ec861bc19fa3da942464628dd3e86e9b82994ca4;hp=c71b9f3ca4a84c661a5a079490c3558b5ccd6ff5;hpb=19799a22062ef658e4ac543ea06fa9193323512a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlrun.pod b/pod/perlrun.pod index c71b9f3..3170df4 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -4,7 +4,7 @@ perlrun - how to execute the Perl interpreter =head1 SYNOPSIS -B S<[ B<-sTuU> ]> +B S<[ B<-CsTuUWX> ]> S<[ B<-hv> ] [ B<-V>[:I] ]> S<[ B<-cw> ] [ B<-d>[:I] ] [ B<-D>[I] ]> S<[ B<-pna> ] [ B<-F>I ] [ B<-l>[I] ] [ B<-0>[I] ]> @@ -130,13 +130,12 @@ distribution for more information). =item Win95/NT -The Win95/NT installation, when using the Activeware port of Perl, +The Win95/NT installation, when using the ActiveState installer for Perl, will modify the Registry to associate the F<.pl> extension with the perl -interpreter. If you install another port of Perl, including the one -in the Win32 directory of the Perl distribution, then you'll have to -modify the Registry yourself. Note that this means you can no -longer tell the difference between an executable Perl program -and a Perl library file. +interpreter. If you install Perl by other means (including building from +the sources), you may have to modify the Registry yourself. Note that +this means you can no longer tell the difference between an executable +Perl program and a Perl library file. =item Macintosh @@ -265,22 +264,35 @@ is equivalent to An alternate delimiter may be specified using B<-F>. +=item B<-C> + +enables Perl to use the native wide character APIs on the target system. +The magic variable C<${^WIDE_SYSTEM_CALLS}> reflects the state of +this switch. See L. + +This feature is currently only implemented on the Win32 platform. + =item B<-c> causes Perl to check the syntax of the program and then exit without -executing it. Actually, it I execute C, C, and C blocks, -because these are considered as occurring outside the execution of -your program. C blocks, however, will be skipped. +executing it. Actually, it I execute C, C, and +C blocks, because these are considered as occurring outside the +execution of your program. C and C blocks, however, will +be skipped. =item B<-d> runs the program under the Perl debugger. See L. -=item B<-d:>I +=item B<-d:>I runs the program under the control of a debugging, profiling, or tracing module installed as Devel::foo. E.g., B<-d:DProf> executes -the program using the Devel::DProf profiler. See L. +the program using the Devel::DProf profiler. As with the B<-M> +flag, options may be passed to the Devel::foo package where they +will be received and interpreted by the Devel::foo::import routine. +The comma-separated list of options must follow a C<=> character. +See L. =item B<-D>I @@ -299,7 +311,7 @@ equivalent to B<-Dtls>): 8 t Trace execution 16 o Method and overloading resolution 32 c String/numeric conversions - 64 P Print preprocessor command for -P + 64 P Print preprocessor command for -P, source file input state 128 m Memory allocation 256 f Format processing 512 r Regular expression parsing and execution @@ -310,6 +322,8 @@ equivalent to B<-Dtls>): 16384 X Scratchpad allocation 32768 D Cleaning up 65536 S Thread synchronization + 131072 T Tokenising + 262144 R Include reference counts of dumped variables (eg when using -Ds) All these flags require B<-DDEBUGGING> when you compile the Perl executable. See the F file in the Perl source distribution @@ -437,8 +451,7 @@ specified in the extension then it will skip that file and continue on with the next one (if it exists). For a discussion of issues surrounding file permissions and B<-i>, -see L. +see L. You cannot use B<-i> to create directories or to strip extensions from files. @@ -557,20 +570,39 @@ the implicit loop, just as in B. =item B<-P> causes your program to be run through the C preprocessor before -compilation by Perl. (Because both comments and B directives begin +compilation by Perl. Because both comments and B directives begin with the # character, you should avoid starting comments with any words -recognized by the C preprocessor such as "if", "else", or "define".) +recognized by the C preprocessor such as C<"if">, C<"else">, or C<"define">. +Also, in some platforms the C preprocessor knows too much: it knows +about the C++ -style until-end-of-line comments starting with C<"//">. +This will cause problems with common Perl constructs like + + s/foo//; + +because after -P this will became illegal code + + s/foo + +The workaround is to use some other quoting separator than C<"/">, +like for example C<"!">: + + s!foo!!; =item B<-s> enables rudimentary switch parsing for switches on the command line after the program name but before any filename arguments (or before -a B<-->). Any switch found there is removed from @ARGV and sets the +an argument of B<-->). This means you can have switches with two leading +dashes (B<--help>). Any switch found there is removed from @ARGV and sets the corresponding variable in the Perl program. The following program -prints "true" if and only if the program is invoked with a B<-xyz> switch. +prints "1" if the program is invoked with a B<-xyz> switch, and "abc" +if it is invoked with B<-xyz=abc>. #!/usr/bin/perl -s - if ($xyz) { print "true\n" } + if ($xyz) { print "$xyz\n" } + +Do note that B<--help> creates the variable ${-help}, which is not compliant +with C. =item B<-S> @@ -692,8 +724,17 @@ can disable or promote into fatal errors specific warnings using C<__WARN__> hooks, as described in L and L. See also L and L. A new, fine-grained warning facility is also available if you want to manipulate entire classes -of warnings; see L (or better yet, its source code) about -that. +of warnings; see L or L. + +=item B<-W> + +Enables all warnings regardless of C or C<$^W>. +See L. + +=item B<-X> + +Disables all warnings regardless of C or C<$^W>. +See L. =item B<-x> I @@ -731,10 +772,13 @@ used. A colon-separated list of directories in which to look for Perl library files before looking in the standard library and the current -directory. If PERL5LIB is not defined, PERLLIB is used. When running -taint checks (because the program was running setuid or setgid, or the -B<-T> switch was used), neither variable is used. The program should -instead say +directory. Any architecture-specific directories under the specified +locations are automatically included if they exist. If PERL5LIB is not +defined, PERLLIB is used. + +When running taint checks (either because the program was running setuid +or setgid, or the B<-T> switch was used), neither variable is used. +The program should instead say: use lib "/my/directory"; @@ -788,6 +832,18 @@ Relevant only if your perl executable was built with B<-DDEBUGGING>, this controls the behavior of global destruction of objects and other references. +=item PERL_ROOT (specific to the VMS port) + +A translation concealed rooted logical name that contains perl and the +logical device for the @INC path on VMS only. Other logical names that +affect perl on VMS include PERLSHR, PERL_ENV_TABLES, and +SYS$TIMEZONE_DIFFERENTIAL but are optional and discussed further in +L and in F in the Perl source distribution. + +=item SYS$LOGIN (specific to the VMS port) + +Used if chdir has no argument and HOME and LOGDIR are not set. + =back Perl also has environment variables that control how Perl handles data