Kentaro Shirakata
argra****@users*****
2006年 4月 8日 (土) 23:44:57 JST
Index: docs/perl/5.8.4/perlrun.pod diff -u /dev/null docs/perl/5.8.4/perlrun.pod:1.1 --- /dev/null Sat Apr 8 23:44:57 2006 +++ docs/perl/5.8.4/perlrun.pod Sat Apr 8 23:44:57 2006 @@ -0,0 +1,2794 @@ +=head1 NAME + +=begin original + +perlrun - how to execute the Perl interpreter + +=end original + +perlrun - Perl C^v^ÌN®û@ + +=head1 SYNOPSIS + +B<perl> S<[ B<-sTtuUWX> ]> + S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]> + S<[ B<-cw> ] [ B<-d>[:I<debugger>] ] [ B<-D>[I<number/list>] ]> + S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal/hexadecimal>] ]> + S<[ B<-I>I<dir> ] [ B<-m>[B<->]I<module> ] [ B<-M>[B<->]I<'module...'> ]> + S<[ B<-P> ]> + S<[ B<-S> ]> + S<[ B<-x>[I<dir>] ]> + S<[ B<-i>[I<extension>] ]> + S<[ B<-e> I<'command'> ] [ B<--> ] [ I<programfile> ] [ I<argument> ]...> + S<[ B<-C [I<number/list>] >]> ]> + +=head1 DESCRIPTION + +=begin original + +The normal way to run a Perl program is by making it directly +executable, or else by passing the name of the source file as an +argument on the command line. (An interactive Perl environment +is also possible--see L<perldebug> for details on how to do that.) +Upon startup, Perl looks for your program in one of the following +places: + +=end original + +Perl vOðÀs·éÊÌû@ÍA¼ÚÀsÅ«é`É·é©A +R}hCÌøƵÄ\[Xt@C̼Oðn·±ÆÅ·B +(ÎbIÈ Perl «à èÜ· -- ÇÌæ¤É·é©ÌÚ×É¢ÄÍ +L<perldebug> ðQƵĺ³¢B) +ÀsÉ ½ÁÄAPerl Íwè³ê½vOðȺɦ·êÅ +TµÜ·: + +=over 4 + +=item 1. + +=begin original + +Specified line by line via B<-e> switches on the command line. + +=end original + +R}hCãÅ -e XCb`Åwè³ê½sB + +=item 2. + +=begin original + +Contained in the file specified by the first filename on the command line. +(Note that systems supporting the #! notation invoke interpreters this +way. See L<Location of Perl>.) + +=end original + +R}hCãÅÅÌt@C¼ÆµÄ¦³ê½t@CÌB +(#! L@ðT|[gµÄ¢éVXeÅÍA±Ìæ¤ÉµÄ +C^v^ðÄÑoµÜ·BL<Location of Perl> ðQƵĺ³¢B) + +=item 3. + +=begin original + +Passed in implicitly via standard input. This works only if there are +no filename arguments--to pass arguments to a STDIN-read program you +must explicitly specify a "-" for the program name. + +=end original + +WüÍ©çÃÙÉn³êéB +t@C¼ð¦·øª³¢êÉÌݤܢ«Ü·B +STDIN ©çÇÝÞvOÉøðn·ÉÍA +vO¼ÆµÄ¾¦IÉ "-" ðwèµÈÄÍÈèܹñA + +=back + +=begin original + +With methods 2 and 3, Perl starts parsing the input file from the +beginning, unless you've specified a B<-x> switch, in which case it +scans for the first line starting with #! and containing the word +"perl", and starts there instead. This is useful for running a program +embedded in a larger message. (In this case you would indicate the end +of the program using the C<__END__> token.) + +=end original + +2 ÔÚA3 ÔÚÌû@ÅÍAB<-x> XCb`ðwèµ½êð¢ÄA +Perl ÍüÍt@CðÅ©çð͵nßÜ·B@B<-x> XCb`ð +wèµ½êÉÍAܸAÅÉ #! Æ "perl" Æ¢¤¶ñð +ÜÞsðTµA»±©çðÍðnßÜ·B +±êÍAå«ÈeLXgÉvOðßñÅAÀs·éæ¤ÈÆ«ÉÖÅ·B +(±ÌêAvOÌIíèÍAg[N C<__END__> ðgÁÄ +¦·Ææ¢Åµå¤B) + +=begin original + +The #! line is always examined for switches as the line is being +parsed. Thus, if you're on a machine that allows only one argument +with the #! line, or worse, doesn't even recognize the #! line, you +still can get consistent switch behavior regardless of how Perl was +invoked, even if B<-x> was used to find the beginning of the program. + +=end original + +#! ðÜÞsÌXCb`ªK¸ðͳêéæ¤ÉÈèܵ½B +ÂÜèA#! ÌsÅøªêµ©³êÈ¢A é¢Í +àÁÆ«A#! ÌsªF¯³êȢƢÁ½VXeÅ^pµÄ¢é +êÉàAB<-x> ÅvOÌJnÊuð©Â¯½êð +ÜßAÇÌæ¤É Perl ªN®³ê½©Éæç¸Aêѵ½ +XCb`Ì®ìðúÒÅ«éæ¤ÉÈÁĢܷB + +=begin original + +Because historically some operating systems silently chopped off +kernel interpretation of the #! line after 32 characters, some +switches may be passed in on the command line, and some may not; +you could even get a "-" without its letter, if you're not careful. +You probably want to make sure that all your switches fall either +before or after that 32-character boundary. Most switches don't +actually care if they're processed redundantly, but getting a "-" +instead of a complete switch could cause Perl to try to execute +standard input instead of your program. And a partial B<-I> switch +could also cause odd results. + +=end original + +ðjIÈIy[eBOVXeÌÉÍ +J[lÉæé #! sÌðߪAG[鵃 32 ¶Å +Å¿Øçêĵܤà̪ èÜ·ÌÅA éXCb`ÍR}hCÉ +n³êA éXCb`Ín³êȢƢÁ½±ÆªN±èÜ·B +ӵȢÆA¶ª±©È¢ "-" ¾¯ªn³êéÆ¢Á½±Æà +N±è¾Ü·B +·×ÄÌXCb`ªAmÀÉ 32 ¶«EÌO©ãë©ÌÇ¿ç©É +Èéæ¤Éµ½¢±Æŵå¤B +½ÌXCb`ÍA]ªÉ³êÄàâè èܹñªA +®SÈXCb`ÌãíèÉ "-" ªüÁÄ¢½êÉÍA +vOÌãíèÉAWüÍð Perl É +Às³¹é±ÆÉÈÁĵܢܷB +B<-I> XCb`ªr¼[ÉÈÁ½êÉ਩µÈÊÆÈè¾Ü·B + +=begin original + +Some switches do care if they are processed twice, for instance +combinations of B<-l> and B<-0>. Either put all the switches after +the 32-character boundary (if applicable), or replace the use of +B<-0>I<digits> by C<BEGIN{ $/ = "\0digits"; }>. + +=end original + +2 ñÀs³êé±ÆÉÓ·éKvÌ éXCb`à èÜ·B +á¦Î B<-l> Æ B<-0> ÌgÝí¹Å·B +(Â\Èç) ¼ûÌXCb`ª 32 ¶«EÌãëÉ¢æ¤É·é©A +B<-0>I<digits> ð C<BEGIN{ $/ = "\0digits"; }> Åu«·¦Ä¾³¢B + +=begin original + +Parsing of the #! switches starts wherever "perl" is mentioned in the line. +The sequences "-*" and "- " are specifically ignored so that you could, +if you were so inclined, say + +=end original + +#! XCb`ÌðÍÍAsàÅ "perl" ª¦³ê½Êu©çnÜèÜ·B +Æèí¯ "-*" Æ "- " Æ¢¤¶ÌÀÑͳ³êÜ·ÌÅA + + #!/bin/sh -- # -*- perl -*- -p + eval 'exec perl -wS $0 ${1+"$@"}' + if $running_under_some_shell; + +=begin original + +to let Perl see the B<-p> switch. + +=end original + +Ìæ¤É¯ÎAPerl É B<-p> XCb`ðn·±ÆªÅ«Ü·B + +=begin original + +A similar trick involves the B<env> program, if you have it. + +=end original + +½æ¤ÈgbNÍ(ÁÄ¢êÎ) B<env> vOÅàg¦Ü·B + + #!/usr/bin/env perl + +=begin original + +The examples above use a relative path to the perl interpreter, +getting whatever version is first in the user's path. If you want +a specific version of Perl, say, perl5.005_57, you should place +that directly in the #! line's path. + +=end original + +ãÌáÍ Perl C^v^ÉÎpXðgÁÄA +[U[Ì PATH ÅÅÉ Á½o[Wðg¢Ü·B +àµÁèÌo[WÌ PerlAá¦Î perl5.005_57 ªg¢½¢ÈçA +#! sÌpXɼÚ׫ŷB + +=begin original + +If the #! line does not contain the word "perl", the program named after +the #! is executed instead of the Perl interpreter. This is slightly +bizarre, but it helps people on machines that don't do #!, because they +can tell a program that their SHELL is F</usr/bin/perl>, and Perl will then +dispatch the program to the correct interpreter for them. + +=end original + +#! sÉ "perl" Æ¢¤êªÜÜêĢȯêÎA#! ÌãÉwè³ê½ +vOª Perl C^v^ÌãíèÉÀs³êÜ·B +±ê͵ÏíÁĢܷªA#! ªsȦȢ}VðgÁÄ¢éûÉÍ +Løŵå¤B +vOÉεÄgÁÄ¢é SHELL ª F</usr/bin/perl> ¾Æ¾ÁĨ¯ÎA +Perl ª³µ¢C^v^ðN®µÄêé©çÅ·B + +=begin original + +After locating your program, Perl compiles the entire program to an +internal form. If there are any compilation errors, execution of the +program is not attempted. (This is unlike the typical shell script, +which might run part-way through before finding a syntax error.) + +=end original + +vOÌêªÁèÅ«½ÈçAPerl ÍvOSÌðà`®É +RpCµnßÜ·B +RpCG[ª©Â©Á½ÉÍAvOÌÀsÍsÈíêܹñB +(±êÍA\¶G[ª éêÉàArÜÅÀs³êéÂ\«Ì éA +T^IÈVFÌXNvgÆÙÈé_Å·B) + +=begin original + +If the program is syntactically correct, it is executed. If the program +runs off the end without hitting an exit() or die() operator, an implicit +C<exit(0)> is provided to indicate successful completion. + +=end original + +vOª\¶Iɳµ¯êÎAÀs³êé±ÆÉÈèÜ·B +vOªAexit() ZqÉà die() ZqÉà½çȢŠ+ÅãÜÅB·éÆA³íÉ®¹µ½±Æ𦷽ßÉAÃÙÌ +C<exit(0)> ªsÈíêÜ·B + +=head2 #! and quoting on non-Unix systems + +(ñ Unix VXeÅÌ #! ÆNH[g) + +=begin original + +Unix's #! technique can be simulated on other systems: + +=end original + +Unix Ì #! ÌeNjbNͼÌVXeÅàV~ [g³êĢܷB + +=over 4 + +=item OS/2 + +=begin original + +Put + +=end original + +C<*.cmd> t@CÌÅÌsÉ + + extproc perl -S -your_switches + +=begin original + +as the first line in C<*.cmd> file (B<-S> due to a bug in cmd.exe's +`extproc' handling). + +=end original + +Ƣľ³¢ (B<-S> Í cmd.exe Ì `extproc' ̵¢Ì +oOðø«N±µÜ·)B + +=item MS-DOS + +=begin original + +Create a batch file to run your program, and codify it in +C<ALTERNATE_SHEBANG> (see the F<dosish.h> file in the source +distribution for more information). + +=end original + +vOðÀs·éob`t@CðìÁÄA +C<ALTERNATE_SHEBANG> ÅR[h»µÄ¾³¢ +(³çÈéîñÉ¢ÄÍ\[XzzpbP[WÌ F<dosish.h> t@Cð +QƵĺ³¢)B + +=item Win95/NT + +=begin original + +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 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. + +=end original + +Win95/NT ÅÌCXg[ɨ¢ÄAActiveState Ì Perl pCXg[[ð +gÁ½êÍAg£q F<.pl> ð Perl C^v^ÉÖAt¯éæ¤ +WXgðÏXµÜ·B +¼Ìû@Å Perl ðCXg[µ½ê(\[X©ç\zµ½êðÜÝÜ·)A +WXgð©ªÅÏX·éKvª èÜ·B +±êÍÀsÂ\È Perl vOÆ Perl Cut@CÆÌ +ᢪÈÈÁĵܤ±ÆÉӵľ³¢B + +=item Macintosh + +=begin original + +A Macintosh perl program will have the appropriate Creator and +Type, so that double-clicking them will invoke the perl application. + +=end original + +Macintosh perl vOÍKØÈ Creator Æ Type ðÁÄ¢éÌÅA +_uNbN·êÎ Perl AvP[VðN®Å«Ü·B + +=item VMS + +=begin original + +Put + +=end original + +vOÌæªÉA + + $ perl -mysw 'f$env("procedure")' 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' ! + $ exit++ + ++$status != 0 and $exit = $status = undef; + +=begin original + +at the top of your program, where B<-mysw> are any command line switches you +want to pass to Perl. You can now invoke the program directly, by saying +C<perl program>, or as a DCL procedure, by saying C<@program> (or implicitly +via F<DCL$PATH> by just using the name of the program). + +=end original + +Ƣľ³¢B±±Å B<-mysw> Í Perl Énµ½¢ +R}hCXCb`Å·B±êÅ C<perl program> ÆµÄ¼Ú +vOðN®Å«Ü·µA +C<@program> ƵÄ( é¢Í F<DCL$PATH> oRÅvO¼ðgÁÄ) +DSL 豫ƵÄN®Å«Ü·B + +=begin original + +This incantation is a bit much to remember, but Perl will display it for +you if you say C<perl "-V:startperl">. + +=end original + +±ÌÜè¶åÍo¦éÉÍX··¬Ü·ªA +C<perl "-V:startperl"> Æ·êÎ Perl ª±êð\¦µÄêÜ·B + +=back + +=begin original + +Command-interpreters on non-Unix systems have rather different ideas +on quoting than Unix shells. You'll need to learn the special +characters in your command-interpreter (C<*>, C<\> and C<"> are +common) and how to protect whitespace and these characters to run +one-liners (see B<-e> below). + +=end original + +ñ Unix VXeÌR}hC^v^ÍNH[gÉÖµÄ +Unix VFÆÙÈÁ½l¦ûðµÄ¢Ü·B +¨g¢ÌR}hC^v^ÌXyVLN^É墀 +(C<*>, C<\>, C<"> ÍêÊIÅ·)A»µÄ +êsÅN®·é½ßÉ(ãq·é B<-e> ðQƵĺ³¢)óâ +XyVLN^ðÛì·éû@É¢ÄwÔKvª éŵå¤B + +=begin original + +On some systems, you may have to change single-quotes to double ones, +which you must I<not> do on Unix or Plan 9 systems. You might also +have to change a single % to a %%. + +=end original + +VXeÉæÁÄÍVONH[gð_uNH[gÉÏX·éKvª + é©àµêܹñBµ©µ Unix â Plan9 ÌVXeÅÍ +I<µÄÍ¢¯Ü¹ñ>B +ܽAPÌÌ % ð %% ÉÏX·éKvª é©àµêܹñB + +=begin original + +For example: + +=end original + +á¦Î: + + # Unix + perl -e 'print "Hello world\n"' + + # MS-DOS, etc. + perl -e "print \"Hello world\n\"" + + # Macintosh + print "Hello world\n" + (then Run "Myscript" or Shift-Command-R) + + # VMS + perl -e "print ""Hello world\n""" + +=begin original + +The problem is that none of this is reliable: it depends on the +command and it is entirely possible neither works. If B<4DOS> were +the command shell, this would probably work better: + +=end original + +âèÍA±êçÍÇêàM«ªÈ¢±ÆÅ·B +±êÍR}hÉ˶µAÇêனȢ©àµêܹñB +B<4DOS> ªR}hVFÈçA¨»çæè殫ܷ: + + perl -e "print <Ctrl-x>"Hello world\n<Ctrl-x>"" + +=begin original + +B<CMD.EXE> in Windows NT slipped a lot of standard Unix functionality in +when nobody was looking, but just try to find documentation for its +quoting rules. + +=end original + +Windows NT Ì B<CMD.EXE> ÍNà©Ä¢È¢ÔɽÌW Unix @\ª +üèñŢܷªANH[gÌ[ÉÖµÄÍ +hL gðTµÄÝľ³¢B + +=begin original + +Under the Macintosh, it depends which environment you are using. The MacPerl +shell, or MPW, is much like Unix shells in its support for several +quoting variants, except that it makes free use of the Macintosh's non-ASCII +characters as control characters. + +=end original + +Macintosh ÅÍAgÁÄ¢é«É˶µÜ·B +MacPerl shell â MPW ÍNH[gÖWÌÎÉÖµÄ +©Èè Unix VFÆĢܷB +µ©µAMacintosh Ìñ ASCII ¶ðRg[¶ÆµÄ +©RÉg¤±ÆªÅ«Ü·B + +=begin original + +There is no general solution to all of this. It's just a mess. + +=end original + +±ÌÓè̱ÆÉÖ·éêÊIÈðû@Í èܹñB +ÜÁ½®¿á®¿áÅ·B + +=head2 Location of Perl + +(Perl ÌÊu) + +=begin original + +It may seem obvious to say, but Perl is useful only when users can +easily find it. When possible, it's good for both F</usr/bin/perl> +and F</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 into a +directory typically found along a user's PATH, or in some other +obvious and convenient place. + +=end original + +½èOÌæ¤É·±¦é©àµêܹñªA +Perl Í[U[ªÈPÉ©Å«éêÉÌÝLpÅ·B +Â\ÈçAF</usr/bin/perl> Æ F</usr/local/bin/perl> ̼ûÉ +ÀÛÌoCiÖÌV{bNNðuÆ¢¤ÌÍæ¢l¦Å·B +൱ꪳÈçAVXeÇÒÍ Perl Æ +t·é[eBeB (ÖÌV{bNN) ðA +T^IÉ[U[Ì PATH Å©t©éfBNg©A +»Ì¼Ì¾ç©ÅÖÈêÉu׫ŷB + +=begin original + +In this documentation, C<#!/usr/bin/perl> on the first line of the program +will stand in for whatever method works on your system. You are +advised to use a specific path if you care about a specific version. + +=end original + +±ÌhL gÅÍAC<#!/usr/bin/perl> ÆvOÌæªÉ¯Î +VXeÌSÄÌ\bhªÀsÅ«éàÌƵĢܷB +ÁèÌo[Wðg¢½¢êÍAÁèÌpXðg¤©: + + #!/usr/local/bin/perl5.00554 + +=begin original + +or if you just want to be running at least version, place a statement +like this at the top of your program: + +=end original + + é¢ÍPÉÅáÀÌo[Wðwèµ½êÍA +ȺÌæ¤ÈsðvOÌæªÉu¢Ä¾³¢: + + use 5.005_54; + +=head2 Command Switches + +(R}hXCb`) + +=begin original + +As with all standard commands, a single-character switch may be +clustered with the following switch, if any. + +=end original + +SÄÌWR}hƯlÉA +1 ¶ÌXCb`ÍAɱXCb`ª êÎA»êÆÂÈ°é +±ÆªÅ«Ü·B + + #!/usr/bin/perl -spi.orig # same as -s -p -i.orig + +=begin original + +Switches include: + +=end original + +XCb`ê: + +=over 5 + +=item B<-0>[I<octal/hexadecimal>] + +=begin original + +specifies the input record separator (C<$/>) as an octal or +hexadecimal number. If there are no digits, the null character is the +separator. Other switches may precede or follow the digits. For +example, if you have a version of B<find> which can print filenames +terminated by the null character, you can say this: + +=end original + +üÍR[hZp[^ (C<$/>) ð 8 iÜ½Í 16 iŦµÜ·B +digits ðwèµÈ¢ÆAk¶ªZp[^ÉÈèÜ·B +¼ÌXCb`ðOÉu¢Äà©Ü¢Ü¹ñµAdigits Ì ÆÉ +ÂÈ°Äà©Ü¢Ü¹ñB +½Æ¦ÎAt@C¼ðk¶ÅæØÁÄ\¦Å«é find ª êÎ: + + find . -name '*.orig' -print0 | perl -n0e unlink + +=begin original + +The special value 00 will cause Perl to slurp files in paragraph mode. +The value 0777 will cause Perl to slurp files whole because there is no +legal byte with that value. + +=end original + +00 Æ¢¤ÁÊÈlÍAPerl ÉpOt[hÅAt@CðÇܹܷB +0777 Æ¢¤lÍAY·éoCgªÈ¢½ßA +Perl Ét@CSÌðÇܹé±ÆÉÈèÜ·B + +=begin original + +If you want to specify any Unicode character, use the hexadecimal +format: C<-0xHHH...>, where the C<H> are valid hexadecimal digits. +(This means that you cannot use the C<-x> with a directory name that +consists of hexadecimal digits.) + +=end original + +Unicode ¶ðwèµ½¢êÍA16 iÌtH[}bg C<-0xHHH...> ð +gÁľ³¢B±±Å C<H> Í 16 iƵÄLøȶŷ +(±êÍ C<-x> Å 16 iÌl©çÈéfBNg¼ðwèÅ«È¢ +±ÆðÓ¡µÜ·)B + +=item B<-a> + +=begin original + +turns on autosplit mode when used with a B<-n> or B<-p>. An implicit +split command to the @F array is done as the first thing inside the +implicit while loop produced by the B<-n> or B<-p>. + +=end original + +B<-n> â B<-p> Æ¢ÁµåÉp¢éÆA©® split [hÉÈèÜ·B +B<-n> â B<-p> ÅìçêéÃÙÌ[vàÌÅ̶ƵÄA +zñ @F ÖÌÃÙÌ split R}hªÀs³êÜ·B + + perl -ane 'print pop(@F), "\n";' + +=begin original + +is equivalent to + +=end original + +ÍȺÌàÌÆ¿Å·B + + while (<>) { + @F = split(' '); + print pop(@F), "\n"; + } + +=begin original + +An alternate delimiter may be specified using B<-F>. + +=end original + +B<-F> ðgÁÄæضðÏX·é±ÆªÅ«Ü·B + +=item B<-C [I<number/list>]> + +=begin original + +The C<-C> flag controls some Unicode of the Perl Unicode features. + +=end original + +C<-C>tOÍ Perl Unicode @\Ì¢Â©Ì Unicode ð§äµÜ·B + +=begin original + +As of 5.8.1, the C<-C> can be followed either by a number or a list +of option letters. The letters, their numeric values, and effects +are as follows; listing the letters is equal to summing the numbers. + +=end original + +5.8.1 ©çAC<-C> tOÍlܽÍIvV¶ÌXgð +¯é±ÆªoÜ·BwèÂ\ȶÆl¨æÑ»ÌøÊÍȺÌÊèÅ·; +¶ÌXgÍlÌvƯ¶Å·B + + I 1 STDIN is assumed to be in UTF-8 + O 2 STDOUT will be in UTF-8 + E 4 STDERR will be in UTF-8 + S 7 I + O + E + i 8 UTF-8 is the default PerlIO layer for input streams + o 16 UTF-8 is the default PerlIO layer for output streams + D 24 i + o + A 32 the @ARGV elements are expected to be strings encoded in UTF-8 + L 64 normally the "IOEioA" are unconditional, + the L makes them conditional on the locale environment + variables (the LC_ALL, LC_TYPE, and LANG, in the order + of decreasing precedence) -- if the variables indicate + UTF-8, then the selected "IOEioA" are in effect + +=begin original + +For example, C<-COE> and C<-C6> will both turn on UTF-8-ness on both +STDOUT and STDERR. Repeating letters is just redundant, not cumulative +nor toggling. + +=end original + +á¦ÎAC<-COE> Æ C<-C6> ÍÇ¿çà STDOUT Æ STDERR ð UTF-8 »µÜ·B +¯¶¶ðJèÔµÄàç·È¾¯ÅAÁZ³ê½ègOÉÈÁ½èÍ +µÜ¹ñB + +=begin original + +The C<io> options mean that any subsequent open() (or similar I/O +operations) will have the C<:utf8> PerlIO layer implicitly applied +to them, in other words, UTF-8 is expected from any input stream, +and UTF-8 is produced to any output stream. This is just the default, +with explicit layers in open() and with binmode() one can manipulate +streams as usual. + +=end original + +C<io> IvVÍø«± open() ( é¢Í¯lÌ I/O ì) ɨ¢Ä +ÃÙIÉ C<:utf8> PerlIO wªKp³êÜ·B +¾¢·¦éÆAüÍXg[ÅÍ UTF-8 ªzè³êAoÍXg[Í +UTF-8 ÅoͳêÜ·B +±êÍPÉftHgÅ èAÊíǨè open() Æ binmode() ž¦IÉ +ÏXÅ«Ü·B + +=begin original + +C<-C> on its own (not followed by any number or option list), or the +empty string C<""> for the C<PERL_UNICODE> environment variable, has the +same effect as C<-CSDL>. In other words, the standard I/O handles and +the default C<open()> layer are UTF-8-fied B<but> only if the locale +environment variables indicate a UTF-8 locale. This behaviour follows +the I<implicit> (and problematic) UTF-8 behaviour of Perl 5.8.0. + +=end original + +C<-C> ªPÌÅ(lâIvVXgȵ)N®³êé©A +C<PERL_UNICODE> «Ϫó¶ñ C<""> ÌêAC<-CSDL> Æ +¯¶øÊÆÈèÜ·B¾¢·¦éÆAW I/O ìÆ +ftHgÌ C<open()> wÍP[«Ϫ UTF-8 P[ð +¦µÄ¢éê B<ÌÝ> UTF-8 »³êÜ·B +±ÌUé¢Í Perl 5.8.0 ÅÌ I<ÃÙÌ> (»µÄâèÌ é) UTF-8 É +Ö·éUé¢Æ¯¶Å·B + +=begin original + +You can use C<-C0> (or C<"0"> for C<PERL_UNICODE>) to explicitly +disable all the above Unicode features. + +=end original + +C<-C0> ( é¢Í C<PERL_UNICODE> É C<"0">) ðwè·éÆ +¾¦IÉãLÌSÄÌ Unicode @\ð³øɵܷB + +=begin original + +The read-only magic variable C<${^UNICODE}> reflects the numeric value +of this setting. This is variable is set during Perl startup and is +thereafter read-only. If you want runtime effects, use the three-arg +open() (see L<perlfunc/open>), the two-arg binmode() (see L<perlfunc/binmode>), +and the C<open> pragma (see L<open>). + +=end original + +ÇÝÝêpÌ}WbNÏ C<${^UNICODE}> ɱÌÝèÌl\»ª +½f³êÜ·B±êÍ Perl N®ÉZbg³êéÏÅAÇÝÝêpÅ·B +ÀsÉøÊð¾½¢êÍA3 øÌ open() (L<perlfunc/open> QÆ), +2 øÌ binmode() (L<perlfunc/binmode> QÆ), C<open> vO} +(L<open> QÆ) ðgÁľ³¢B + +=begin original + +(In Perls earlier than 5.8.1 the C<-C> switch was a Win32-only switch +that enabled the use of Unicode-aware "wide system call" Win32 APIs. +This feature was practically unused, however, and the command line +switch was therefore "recycled".) + +=end original + +(5.8.1 ÈOÌ Perl ÅÍ C<-C> XCb`Í Win32 êpÌXCb`ÅA +Unicode ÎÌ "Ch¶VXeR[" Win32 API ðg¤½ßÌàÌŵ½B +±Ì@\ÍÀãgíêܹñŵ½ªAR}hCXCb`Í +"Äp" ³êܵ½B) + +=item B<-c> + +=begin original + +causes Perl to check the syntax of the program and then exit without +executing it. Actually, it I<will> execute C<BEGIN>, C<CHECK>, and +C<use> blocks, because these are considered as occurring outside the +execution of your program. C<INIT> and C<END> blocks, however, will +be skipped. + +=end original + +Perl ÉXNvgÌ\¶Ì`FbNðsÈí¹AÀs¹¸É +I¹·éæ¤ÉµÜ·B +ÀÛÉÍAC<BEGIN>, C<CHECK>, C<use> ubNÍ I<ÀsµÜ·>B +±êçÍvOÌÀsÌO¤É éàÌÆl¦çêé©çÅ·B +C<INIT> Æ C<END> ubNÍXLbv³êÜ·B + +=item B<-d> + +=begin original + +runs the program under the Perl debugger. See L<perldebug>. + +=end original + +Perl fobK̺ÅvOðÀsµÜ·B +L<perldebug> ðQƵľ³¢B + +=item B<-d:>I<foo[=bar,baz]> + +=begin original + +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. 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<perldebug>. + +=end original + +Devel::foo ƵÄCXg[³êé fobOEvt@COE +g[XW [̧äºÅvOðÀsµÜ·B +ÂÜèAB<-d:DProf> Í Devel::DProf vt@CðgÁÄ +vOðÀsµÜ·B +B<-M> tOƤÉg¤ÆAIvVÍ +Devel::foo pbP[WÉn³êADevel::foo::import [`Å +ðß³êÜ·B +IvVðR}æØèÌXgÉ·éÆ«Í C<=> Ì¶Ì +ãɱ¯È¯êÎÈèܹñBL<perldebug> ðQƵĺ³¢B + +=item B<-D>I<letters> + +=item B<-D>I<number> + +=begin original + +sets debugging flags. To watch how it executes your program, use +B<-Dtls>. (This works only if debugging is compiled into your +Perl.) Another nice value is B<-Dx>, which lists your compiled +syntax tree. And B<-Dr> displays compiled regular expressions; +the format of the output is explained in L<perldebguts>. + +=end original + +fobOtOðÝèµÜ·B +XNvgªÇÌæ¤ÉÀs³êé©ð©éÉÍA +B<-Dtls> ðgÁľ³¢B +(±êÍAfobO@\ð·èñÅ +RpCµ½Æ«É¾¯«Ü·B) +±Ì¼ÉðɧÂlƵÄÍARpC³ê½\¶c[ð\¦·éA +B<-Dx> ª °çêÜ·B +B<-Dr> ÍARpCµ½³K\»ð\¦µÜ·B +oÍ`®É¢ÄÍ L<perldebguts> Éྪ èÜ·B + +=begin original + +As an alternative, specify a number instead of list of letters (e.g., +B<-D14> is equivalent to B<-Dtls>): + +=end original + +¶ÌXgÌãíèÉðwè·é±ÆàÅ«Ü· +(½Æ¦ÎAB<-D14> Í B<-Dtls> Æ¿Å·): + +=begin original + + 1 p Tokenizing and parsing + 2 s Stack snapshots + with v, displays all stacks + 4 l Context (loop) stack processing + 8 t Trace execution + 16 o Method and overloading resolution + 32 c String/numeric conversions + 64 P Print profiling info, preprocessor command for -P, source file input state + 128 m Memory allocation + 256 f Format processing + 512 r Regular expression parsing and execution + 1024 x Syntax tree dump + 2048 u Tainting checks + 4096 (Obsolete, previously used for LEAKTEST) + 8192 H Hash dump -- usurps values() + 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) + 524288 J Do not s,t,P-debug (Jump over) opcodes within package DB + 1048576 v Verbose: use in conjunction with other flags + 2097152 C Copy On Write + +=end original + + 1 p g[N»Æ\¶ðÍ + 2 s X^bNÌ\¦ + v ƹp³êéÆASÄÌX^bNÌ\¦ + 4 l ReLXg([v)X^bNÌ + 8 t ÀsÌg[X + 16 o \bhÆI[o[[hÌð + 32 c ¶ñ/lÏ· + 64 P vt@COîñA-P ̽ßÌvvZbTR}hA\[Xt@CüÍóÔÌ\¦ + 128 m zu + 256 f tH[}bgÌ + 512 r ³K\»ÌðÍÆÀø + 1024 x \¶g[Ì_v + 2048 u õ`FbN + 4096 (âàÌ: ÈOÍ LEAKTEST ÉgíêÄ¢½) + 8192 H nbV Ì_v -- values() Ì¡æè + 16384 X XNb`pbhÌzu + 32768 D SÁ + 65536 S Xbh¯ú + 131072 T g[N» + 262144 R _v³ê½ÏÌt@XJEgðÜÞ(-DsÌÆ«) + 524288 J DB pbP[WÌÅÍ s,t,P fobOR[hðÀsµÈ¢ + 1048576 v Ú×: ¼ÌtOÆgÝí¹Äg¤ + 2097152 C Rs[ICg + +=begin original + +All these flags require B<-DDEBUGGING> when you compile the Perl +executable (but see L<Devel::Peek>, L<re> which may change this). +See the F<INSTALL> file in the Perl source distribution +for how to do this. This flag is automatically set if you include B<-g> +option when C<Configure> asks you about optimizer/debugger flags. + +=end original + +±êçÌSÄÌtOÍ Perl Àst@CðRpC·éÆ«É +B<-DDEBUGGING> ªwè³êÄ¢éKvª èÜ· +(Aµ±êðÏX·éÆ«Í L<Devel::Peek>, L<re> ðQƵľ³¢)B +»¤·é½ßÉǤ·ê΢¢©É¢ÄÍ Perl Ì\[XzzpbP[WÌ +F<INSTALL> t@CðQƵĺ³¢B +±ÌtOÍ C<Configure> ªÅK»/fobKtOðqË½Æ«É +B<-g> IvVÝÅwè·êΩ®IÉZbg³êÜ·B + +=begin original + +If you're just trying to get a print out of each line of Perl code +as it executes, the way that C<sh -x> provides for shell scripts, +you can't use Perl's B<-D> switch. Instead do this + +=end original + +VFXNvgɨ¯é C<sh -x> Ìæ¤ÉA +PÉ¡ÀsµÄ¢é Perl ÌR[hð\¦µ½¢êÍA +Perl Ì B<-D> XCb`Íg¦Ü¹ñBãíèÉȺÌæ¤ÉµÄ¾³¢: + + # If you have "env" utility + env=PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program + + # Bourne shell syntax + $ PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program + + # csh syntax + % (setenv PERLDB_OPTS "NonStop=1 AutoTrace=1 frame=2"; perl -dS program) + +=begin original + +See L<perldebug> for details and variations. + +=end original + +Ú×ÆoG[VÉ¢ÄÍ L<perldebug> ðQƵĺ³¢B + +=item B<-e> I<commandline> + +=begin original + +may be used to enter one line of program. If B<-e> is given, Perl +will not look for a filename in the argument list. Multiple B<-e> +commands may be given to build up a multi-line script. Make sure +to use semicolons where you would in a normal program. + +=end original + +1 sÌvOðwè·éÌÉgpµÜ·B +B<-e> ªwè³êéÆ Perl ÍøÌXg©çÍt@C¼ðTµÜ¹ñB +¡Ì -e R}hÅA¡sÌXNvgð\¬·é±ÆªÅ«Ü·B +ÊíÌvOÅZ~RðuƱëÉÍAZ~Rðg¤±ÆÉ +Cðt¯Ä¾³¢B + +=item B<-F>I<pattern> + +=begin original + +specifies the pattern to split on if B<-a> is also in effect. The +pattern may be surrounded by C<//>, C<"">, or C<''>, otherwise it will be +put in single quotes. + +=end original + +B<-a> àLøÈÆ«ÉAsplit ðsȤ³K\»ðwèµÜ·B +p^[Í C<//>, C<"">, C<''> ÅÍÞ©A +VONH[gÌÉ«Ü·B + +=item B<-h> + +=begin original + +prints a summary of the options. + +=end original + +IvVÌêð\¦µÜ·B + +=item B<-i>[I<extension>] + +=begin original + +specifies that files processed by the C<E<lt>E<gt>> construct are to be +edited in-place. It does this by renaming the input file, opening the +output file by the original name, and selecting that output file as the +default for print() statements. The extension, if supplied, is used to +modify the name of the old file to make a backup copy, following these +rules: + +=end original + +C<E<lt>E<gt>> Ì\¶Å³ê½t@Cðu«·¦é½ßÌg£qð +wèµÜ·B +±êÍAüÍt@Cðl[µA³Ì¼OÅoÍt@Cð open µA +print() ¶ÌftHgƵĻÌoÍt@Cð select ·é±ÆÅsȢܷB +extension ªwè³êéÆAÌÌàeÌobNAbvðsȤ +t@C¼Ìg£qƵÄA³Ìt@C¼Ét¯Á¦çêÜ·B + +=begin original + +If no extension is supplied, no backup is made and the current file is +overwritten. + +=end original + +extension ªwè³êÈ¢ÆAobNAbvðìç¸A +»ÝÌt@Cªã«³êÜ·B + +=begin original + +If the extension doesn't contain a C<*>, then it is appended to the +end of the current filename as a suffix. If the extension does +contain one or more C<*> characters, then each C<*> is replaced +with the current filename. In Perl terms, you could think of this +as: + +=end original + +extension É C<*> ªÜÜêĢȢêA»ÝÌt@C¼ÌöÉ +ÚöqƵÄt¯Á¦çêÜ·B +extension ÉêÂÈãÌ C<*> ̶ª éêA +»ê¼êÌ C<*> Í»ÝÌt@C¼Åu«·¦çêÜ·B +Perl IÉÆAȺÌæ¤ÉÈèÜ·: + + ($backup = $extension) =~ s/\*/$file_name/g; + +=begin original + +This allows you to add a prefix to the backup file, instead of (or in +addition to) a suffix: + +=end original + +ȺÌæ¤É·éÆA(ÚöqÌãíèÉA é¢ÍÚöqÉÁ¦Ä) +obNAbvt@CÉÚªqð¯é±ÆªÅ«Ü·B + + $ perl -pi'orig_*' -e 's/bar/baz/' fileA # backup to 'orig_fileA' + +=begin original + +Or even to place backup copies of the original files into another +directory (provided the directory already exists): + +=end original + +³Ìt@CÌobNAbvRs[ð(ùÉ é)¼ÌfBNgÉìé±Æà +Å«Ü·: + + $ perl -pi'old/*.orig' -e 's/bar/baz/' fileA # backup to 'old/fileA.orig' + +=begin original + +These sets of one-liners are equivalent: + +=end original + +ȺÌêsXNvgÍSÄ¿Å·: + + $ perl -pi -e 's/bar/baz/' fileA # overwrite current file + $ perl -pi'*' -e 's/bar/baz/' fileA # overwrite current file + + $ perl -pi'.orig' -e 's/bar/baz/' fileA # backup to 'fileA.orig' + $ perl -pi'*.orig' -e 's/bar/baz/' fileA # backup to 'fileA.orig' + +=begin original + +From the shell, saying + +=end original + +VF©çȺÌæ¤ÉN®·éÆ: + + $ perl -p -i.orig -e "s/foo/bar/; ... " + +=begin original + +is the same as using the program: + +=end original + +vOÅȺÌæ¤É·éÌƯ¶Å: + + #!/usr/bin/perl -pi.orig + s/foo/bar/; + +=begin original + +which is equivalent to + +=end original + +ȺÆÙÚ¿Å·: + + #!/usr/bin/perl + $extension = '.orig'; + LINE: while (<>) { + if ($ARGV ne $oldargv) { + if ($extension !~ /\*/) { + $backup = $ARGV . $extension; + } + else { + ($backup = $extension) =~ s/\*/$ARGV/g; + } + rename($ARGV, $backup); + open(ARGVOUT, ">$ARGV"); + select(ARGVOUT); + $oldargv = $ARGV; + } + s/foo/bar/; + } + continue { + print; # this prints to original filename + } + select(STDOUT); + +=begin original + +except that the B<-i> form doesn't need to compare $ARGV to $oldargv to +know when the filename has changed. It does, however, use ARGVOUT for +the selected filehandle. Note that STDOUT is restored as the default +output filehandle after the loop. + +=end original + +á¤ÌÍAB<-i> Ì`®ªA¢Ât@C¼ªÏíÁ½©ðmé½ßÉA +$ARGV Æ $oldargv ðär·éKvªÈ¢±ÆÅ·B +µ©µÈªçAIð·ét@CnhÆµÄ ARGVOUT ÍgpµÜ·B +[vÌ ÆÍASTDOUT ªftHgÌt@CnhƵÄÄÝè³êÜ·B + +=begin original + +As shown above, Perl creates the backup file whether or not any output +is actually changed. So this is just a fancy way to copy files: + +=end original + +ãqÌÊèAPerl ÍobNAbvt@CðÀÛÉoͪÏX³ê½© +Ǥ©ÉÖíç¸ì¬µÜ·B]ÁÄAȺÍt@CðRs[·é +ÏíÁ½û@ÆÈèÜ·: + + $ perl -p -i'/some/file/path/*' -e 1 file1 file2 file3... +or + $ perl -p -i'.orig' -e 1 file1 file2 file3... + +=begin original + +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>). + +=end original + +ÂXÌt@CÌIíèɽ©ðt¯Á¦½¢Æ«âAsÔð +Zbgµ½¢æ¤ÈêÉAÂXÌüÍt@CÌIíèðmé½ßÉA +Ê̳¢ C<eof> ðg¤±ÆªÅ«Ü·B +(L<perlfunc/eof> ÌáðQƵľ³¢B) + +=begin original + +If, for a given file, Perl is unable to create the backup file as +specified in the extension then it will skip that file and continue on +with the next one (if it exists). + +=end original + +^¦çê½t@CÉεÄAPerl ªwè³ê½g£qÅobNAbvt@Cð +ìêÈ¢êA»Ìt@CÍXLbv³êÄ +(ൠêÎ)Ìt@CÉÚÁÄp±µÜ·B + +=begin original + +For a discussion of issues surrounding file permissions and B<-i>, +see L<perlfaq5/Why does Perl let me delete read-only files? Why does -i clobber protected files? Isn't this a bug in Perl?>. + +=end original + +t@CÌp[~bVÆ B<-i> ÉÖ·éc_É¢ÄÍA +L<perlfaq5/Why does Perl let me delete read-only files? Why does -i clobber protected files? Isn't this a bug in Perl?> ð +QƵĺ³¢B + +=begin original + +You cannot use B<-i> to create directories or to strip extensions from +files. + +=end original + +B<-i> ÍAfBNgðìÁ½èAt@CÌg£qðæ袽èÍ +ūܹñB + +=begin original + +Perl does not expand C<~> in filenames, which is good, since some +folks use it for their backup files: + +=end original + +Perl Í C<~> ðWJµÜ¹ñB +±êÍobNAbvt@CðȺÌæ¤ÉµÄìélX̽ßÉÍ +梱ÆÅ·B + + $ perl -pi~ -e 's/foo/bar/' file1 file2 file3... + +=begin original + +Finally, the B<-i> switch does not impede execution when no +files are given on the command line. In this case, no backup is made +(the original file cannot, of course, be determined) and processing +proceeds from STDIN to STDOUT as might be expected. + +=end original + +ÅãÉAB<-i> XCb`ÍAR}hCÅt@Cªwè³êÈÄà +ÀsðW°Ü¹ñB±ÌêAobNAbvt@CÍì¬³ê¸ +(à¿ëñA³Ìt@Cªèūܹñ)A +\zÊèASTDIN ©ç STDOUT ɪsíêÜ·B + +=item B<-I>I<directory> + +=begin original + +Directories specified by B<-I> are prepended to the search path for +modules (C<@INC>), and also tells the C preprocessor where to search for +include files. The C preprocessor is invoked with B<-P>; by default it +searches /usr/include and /usr/lib/perl. + +=end original + +B<-I> Åwè³ê½fBNgÍW [ÌõpX(C<@INC>)É +Á¦çêAܽ C vvZbTÉCN[ht@CðT·êð¦µÜ·B +C vvZbTÍ B<-P> ÅN®³êÜ·B +ftHgÅÍ /usr/include Æ /usr/lib/perl ðTµÜ·B + +=item B<-l>[I<octnum>] + +=begin original + +enables automatic line-ending processing. It has two separate +effects. First, it automatically chomps C<$/> (the input record +separator) when used with B<-n> or B<-p>. Second, it assigns C<$\> +(the output record separator) to have the value of I<octnum> so +that any print statements will have that separator added back on. +If I<octnum> is omitted, sets C<$\> to the current value of +C<$/>. For instance, to trim lines to 80 columns: + +=end original + +©®ÌsðsȤæ¤ÉµÜ·B +±êÉÍA2 ÂÌƧµ½@\ª èÜ·B +1 ÂÉÍAB<-n> â B<-p> ðgÁ½Æ«ÉA +©®IÉC<$/>(üÍR[hZp[^)ð chomp µÜ·B +2 ÂßÉ octnum ð C<$\>(oÍR[hZp[^) ÉãüµA +print ¶ÅZp[^ðÇÁÅ«éæ¤ÉµÜ·B +octnum ðwèµÈ©Á½êÉÍA»Ì_Ì C<$/> Ìlð +C<$\> ÉÝèµÜ·B +½Æ¦ÎAsð 80 JÉØèlßéÉÍȺÌæ¤ÉµÜ·: + + perl -lpe 'substr($_, 80) = ""' + +=begin original + +Note that the assignment C<$\ = $/> is done when the switch is processed, +so the input record separator can be different than the output record +separator if the B<-l> switch is followed by a B<-0> switch: + +=end original + +C<$\ = $/> Æ¢¤ãüÍAB<-l> XCb`ª³êéÆ«É +Às³êéÆ«ÉsÈíêÜ·ÌÅAB<-l> XCb`ÌãÉ +B<-0> XCb`ðuæ¤É·êÎAüÍR[hZp[^ðA +oÍR[hZp[^Æá¤æ¤ÉàÅ«Ü·: + + gnufind / -print0 | perl -ln0e 'print "found $_" if -p' + +=begin original + +This sets C<$\> to newline and then sets C<$/> to the null character. + +=end original + +±êÍܸAC<$\> Éüs (C<$/> ÌftHgl) ðÝèµA +»ê©ç C<$/> Ék¶ðÝèµÜ·B + +=item B<-m>[B<->]I<module> + +=item B<-M>[B<->]I<module> + +=item B<-M>[B<->]I<'module ...'> + +=item B<-[mM]>[B<->]I<module=arg[,arg]...> + +=begin original + +B<-m>I<module> executes C<use> I<module> C<();> before executing your +program. + +=end original + +B<-m>I<module> ÍvOÌÀsOÉ C<use> I<module> C<();> ð +ÀsµÜ·B + +=begin original + +B<-M>I<module> executes C<use> I<module> C<;> before executing your +program. You can use quotes to add extra code after the module name, +e.g., C<'-Mmodule qw(foo bar)'>. + +=end original + +B<-M>I<module> ÍvOÌÀsOÉ C<use> I<module> C<;> ð +ÀsµÜ·BW [¼ÌãëÉÇÁÌR[hðÁ¦é½ßÉ +NH[gðg¤±ÆàÅ«Ü·BÂÜè C<'-Mmodule qw(foo bar)'> ÈÇÅ·B + +=begin original + +If the first character after the B<-M> or B<-m> is a dash (C<->) +then the 'use' is replaced with 'no'. + +=end original + +B<-M> Ü½Í B<-m> ÌãÌÅ̶ª_bV (C<->)ÌêA +'use' ÌãíèÉ 'no' ªgíêÜ·B + +=begin original + +A little builtin syntactic sugar means you can also say +B<-mmodule=foo,bar> or B<-Mmodule=foo,bar> as a shortcut for +C<'-Mmodule qw(foo bar)'>. This avoids the need to use quotes when +importing symbols. The actual code generated by B<-Mmodule=foo,bar> is +C<use module split(/,/,q{foo,bar})>. Note that the C<=> form +removes the distinction between B<-m> and B<-M>. + +=end original + +¬³¢gÝÝ̶@IV K[ƵÄA +C<'-Mmodule qw(foo bar)'> ÌãíèÉ +B<-mmodule=foo,bar> Ü½Í B<-Mmodule=foo,bar> ƱƪūܷB +±êÅAC|[g·éV{ÉNH[gðgíÈÄàæ¢æ¤ÉÈèÜ·B +B<-Mmodule=foo,bar> Ŷ¬³êéÀÛÌR[hÍ +C<use module split(/,/,q{foo,bar})> Å·B +C<=> Ì`Í B<-m> Æ B<-M> ÌÔÌá¢ðæè±ÆÉӵľ³¢B + +=item B<-n> + +=begin original + +causes Perl to assume the following loop around your program, which +makes it iterate over filename arguments somewhat like B<sed -n> or +B<awk>: + +=end original + +ȺÌæ¤È[vªAÀÛÌvOÌñèÉ é©Ìæ¤É +Perl Éw¦µÜ·B +B<sed -n> â B<awk> Ìæ¤Ét@C¼øãÅJèÔµð +sȤ±ÆÉÈèÜ·: + + LINE: + while (<>) { + ... # your program goes here + } + +=begin original + +Note that the lines are not printed by default. See B<-p> to have +lines printed. If a file named by an argument cannot be opened for +some reason, Perl warns you about it and moves on to the next file. + +=end original + +ftHgÅÍAesªó³êé±ÆÍ èܹñB +esÌóðsȤÉÍ B<-p> ðQƵľ³¢B +øÅwè³ê½t@CªÈñç©ÌRÅI[vÅ«È©Á½êA +Perl ÍxðoµÄÌt@CÉÚèÜ·B + +=begin original + +Here is an efficient way to delete all files that haven't been modifed for +at least a week: + +=end original + +鼃 °éÌÍAÈÆà 1 TÔÈãXV³êĢȢ@Cðø¦IÉ +í·éàÌÅ·: + + find . -mtime +7 -print | perl -nle unlink + +=begin original + +This is faster than using the B<-exec> switch of B<find> because you don't +have to start a process on every filename found. It does suffer from +the bug of mishandling newlines in pathnames, which you can fix if +you follow the example under B<-0>. + +=end original + +±êÍAt@C¼ª©Â©é²ÆÉvZXðN®µÈÄÏÝÜ·ÌÅA +B<find> Ì B<-exec> XCb`ðg¤æèà¬ÈèÜ·B +±êÍpX¼ÉüsR[hª éƤܵ¦È¢oOÌe¿ðó¯Ü·ÌÅA +B<-O> ÌáÉ]¤±ÆÅC³Å«Ü·B + +=begin original + +C<BEGIN> and C<END> blocks may be used to capture control before or after +the implicit program loop, just as in B<awk>. + +=end original + +B<awk> Ư¶æ¤ÉAÃÙÉÀs³êévO[vÌOãÉ +Às³êéR[hðwè·é½ßÉAC<BEGIN> ubNÆ +C<END> ubNðg¤±ÆªÅ«Ü·B + +=item B<-p> + +=begin original + +causes Perl to assume the following loop around your program, which +makes it iterate over filename arguments somewhat like B<sed>: + +=end original + +ȺÌæ¤È[vªAÀÛÌvOÌñèÉ é©Ìæ¤É +Perl Éw¦µÜ·B +B<sed> Ìæ¤Ét@C¼øãÅJèÔµðsȤ±ÆÉÈèÜ·: + + + LINE: + while (<>) { + ... # your program goes here + } continue { + print or die "-p destination: $!\n"; + } + +=begin original + +If a file named by an argument cannot be opened for some reason, Perl +warns you about it, and moves on to the next file. Note that the +lines are printed automatically. An error occurring during printing is +treated as fatal. To suppress printing use the B<-n> switch. A B<-p> +overrides a B<-n> switch. + +=end original + +øÅwè³ê½t@Cª½ç©ÌRÅI[vÅ«È¢êA +Perl ÍxðoµAÌt@CÉÚèÜ·B +esÍA©®IÉó³êé±ÆÉÈèÜ·B +óÌG[Ív½IÆÝȳêÜ·B +óð}§·éÉÍAB<-n> XCb`ðgÁľ³¢B +B<-p> Í B<-n> XCb`ð³øɵܷB + +=begin original + +C<BEGIN> and C<END> blocks may be used to capture control before or after +the implicit loop, just as in B<awk>. + +=end original + +B<awk> Ư¶æ¤ÉAÃÙÉÀs³êé[vÌOãÉ +Às³êéR[hðwè·é½ßÉAC<BEGIN> ubNÆ +C<END> ubNðg¤±ÆªÅ«Ü·B + +=item B<-P> + +=begin original + +B<NOTE: Use of -P is strongly discouraged because of its inherent +problems, including poor portability.> + +=end original + +B<Ó: -P ÌgpÍSEßçêܹñBȺÈçá¢ÚA«ðÜÞA +æVIÈâèª é©çÅ·> + +=begin original + +This option causes your program to be run through the C preprocessor before +compilation by Perl. Because both comments and B<cpp> directives begin +with the # character, you should avoid starting comments with any words +recognized by the C preprocessor such as C<"if">, C<"else">, or C<"define">. + +=end original + +Perl ÉæéRpCðsȤOÉAXNvgð C vvZbTÉ +©¯éæ¤ÉµÜ·B +Rgà cpp ÌfBNeBuà # ÅnÜèÜ·©çARgÌÅð +C vvZbTªF¯µÄµÜ¤ C<"if">, C<"else">, C<"define">Æ¢Á½ +PêÅnßé׫ÅÍ èܹñB + +=begin original + +If you're considering using C<-P>, you might also want to look at the +Filter::cpp module from CPAN. + +=end original + +C<-P> ðg¤±Æðl¦Ä¢éÈçACPAN É é Filter::cpp à +QƵ½Ù¤ªæ¢Åµå¤B + +=begin original + +The problems of -P include, but are not limited to: + +=end original + +-P ªÂâèÍȺÌæ¤Èà̪ èÜ·(±ê¾¯ÅÍ èܹñ): + +=over 10 + +=item * + +=begin original + +The C<#!> line is stripped, so any switches there don't apply. + +=end original + +C<#!> sªæè©êéÌÅASÄÌXCb`ÍKp³êܹñB + +=item * + +=begin original + +A C<-P> on a C<#!> line doesn't work. + +=end original + +C<#!> sÉ C<-P> ð¢Äà®ìµÜ¹ñB + +=item * + +=begin original + +B<All> lines that begin with (whitespace and) a C<#> but +do not look like cpp commands, are stripped, including anything +inside Perl strings, regular expressions, and here-docs . + +=end original + +(óÆ) C<#> ÅnÜèAcpp R}hÅÈ¢ B<SÄÌ> sÍæè©êÜ·B +Perl ¶ñâ³K\»âqhL gÌÆrÅàAÅ·B + +=item * + +=begin original + +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 + +=end original + +ܽAC vZbTªm跬ĢévbgtH[à èÜ·B +C++ X^CÌ C<"//"> Æ¢¤usÜÅÌRgvðmÁÄ¢éêÅ·B +±ÌêAȺÌæ¤ÈÇ é Perl Ì\¢ÅâèªN±è¾Ü·: + + s/foo//; + +=begin original + +because after -P this will became illegal code + +=end original + +ȺÈç -P KpãȺÌæ¤Ès³ÈR[hÉÈé©çÅ·B + + s/foo + +=begin original + +The workaround is to use some other quoting separator than C<"/">, +like for example C<"!">: + +=end original + +ñðôƵÄÍANI[g¶ð C<"/"> ÈOÉ·éû@ª èÜ·B +ȺÅÍ C<"!"> ɵĢܷ: + + s!foo!!; + + + +=item * + +=begin original + +It requires not only a working C preprocessor but also a working +F<sed>. If not on UNIX, you are probably out of luck on this. + +=end original + +±êÍ C vvZbT¾¯ÅÈAF<sed> à®ì·éKvª èÜ·B +UNIX ÅÈ¢êA»Ìæ¤ÈK^ÉbÜêÈ¢©àµêܹñB + +=item * + +=begin original + +Script line numbers are not preserved. + +=end original + +XNvgÌsÔÍÛ¶³êܹñB + +=item * + +=begin original + +The C<-x> does not work with C<-P>. + +=end original + +C<-x> Í C<-P> ƯÉÍ®ìµÜ¹ñB + +=back + +=item B<-s> + +=begin original + +enables rudimentary switch parsing for switches on the command +line after the program name but before any filename arguments (or before +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 "1" if the program is invoked with a B<-xyz> switch, and "abc" +if it is invoked with B<-xyz=abc>. + +=end original + +R}hCãÌvO¼Ìã©çAt@C¼ø +(ܽÍø B<-->) ÌOÜÅÌXCb`̽ßÌA´nIÈðÍð +sȦéæ¤ÉµÜ·B +±êÍAñÂÌ_bV ªOÉÂXCb`(B<--help> ÈÇ)à +g¦é±Æð¦µÜ·B +±±Å©Â©Á½XCb`ÍA + @ ARGV ©çæè©êAηé Perl vOÌÏÉ +Ýè³êÜ·B@ȺÌvOÍAB<-xyz> Æ¢¤XCb`ð +t¯ÄÀs³ê½É¾¯A"1" Æ\¦µA +B<-xyz=abc> ÆN®³ê½É "abc" Æ\¦µÜ·B + + #!/usr/bin/perl -s + if ($xyz) { print "$xyz\n" } + +=begin original + +Do note that B<--help> creates the variable ${-help}, which is not compliant +with C<strict refs>. + +=end original + +B<--help> ÍÏ ${-help} ð쬷éÌÅAC<strict refs> ð½³È¢ +±ÆÉӵľ³¢B + +=item B<-S> + +=begin original + +makes Perl use the PATH environment variable to search for the +program (unless the name of the program contains directory separators). + +=end original + +Perl ªvOðT·Æ«ÉÂ«Ï PATH ðQÆ·éæ¤ÉµÜ· +(vO¼ªfBNgZp[^ðÜÞÆ«ð«Ü·)B + +=begin original + +On some platforms, this also makes Perl append suffixes to the +filename while searching for it. For example, on Win32 platforms, +the ".bat" and ".cmd" suffixes are appended if a lookup for the +original name fails, and if the name does not already end in one +of those suffixes. If your Perl was compiled with DEBUGGING turned +on, using the -Dp switch to Perl shows how the search progresses. + +=end original + +vbgtH[ÉæÁÄÍAPerl Ít@CðT·Æ«Ég£qð +ÇÁµÜ·B +á¦Î Win32 vbgtH[ÅÍA +³XÌt@C¼Åõª¸sµ½êA".bat" Æ ".cmd" Ìg£qª +ÇÁ³êÜ·BAµùÉ»Ìæ¤Èg£qªÂ¢Ä¢È¢ê¾¯Å·B +Perl ª DEBUGGING ðLøɵÄRpC³êÄ¢½êA +-Dp XCb`ðg¤±ÆÅÇÌæ¤ÉõªsíêÄ¢é©ð +\¦³¹é±ÆªÅ«Ü·B + +=begin original + +Typically this is used to emulate #! startup on platforms that +don't support #!. This example works on many platforms that +have a shell compatible with Bourne shell: + +=end original + +±êÍA#! ðT|[gµÄ¢È¢vbgtH[ÅA#! É +æéÀsðG~ [g·é½ßÉg¢Ü·B +±ÌáÍ Bourne shell Ý·ÌVFð½ÌvbgtH[Å®«Ü·: + + #!/usr/bin/perl + eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}' + if $running_under_some_shell; + +=begin original + +The system ignores the first line and feeds the program to F</bin/sh>, +which proceeds to try to execute the Perl program as a shell script. +The shell executes the second line as a normal shell command, and thus +starts up the Perl interpreter. On some systems $0 doesn't always +contain the full pathname, so the B<-S> tells Perl to search for the +program if necessary. After Perl locates the program, it parses the +lines and ignores them because the variable $running_under_some_shell +is never true. If the program 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 B<csh>, B<sh>, or Perl, such as the following: + +=end original + +VXeÍAÅÌsð³µAvOð F</bin/sh> ÉnµA +F</bin/sh> Í Perl vOðVFvOƵÄÀsµæ¤ÆµÜ·B +VFÍ 2 sÚðÊíÌVFR}hƵÄÀsµAPerl C^v^ð +N®·é±ÆÉÈèÜ·B +$0 ÉtpX¼ªüÁÄ¢éÆÍÀçÈ¢VXeà + èÜ·ÌÅA-S ª Perl ÉKvɶÄvOðT·æ¤Éw¦µÜ·B +Perl ªvOð©Â¯éÆA±êçÌsÌðÍðnßÜ·ªA +$running_under_some_shell ª^ÉÈé±ÆªÈ¢½ßA +³·é±ÆÉÈèÜ·B +vOª csh Åðß³êéêÉÍA +½Æ¦t@C¼àÉßÜê½Xy[XÈÇ𵤱ƪūÈÄà +C<${1+"$@"}> ð C<$*> Åu«·¦éKvª é©àµêܹñB +csh ÅÍÈAsh ðN®·éæ¤ÉA¢Â©ÌVXeÅÍA#! Ìsð +Perl à³·é±ÆÉÈÁÄ¢éAR¾¯ÌsÅu«·¦éKvª + é©àµêܹñB +»¤¢Á½§äªø©È¢VXeÅÍAB<csh> Åà B<sh> Åà +Perl Åàg¦éAñèÇ¢û@ðg¤±ÆªKvÅ·: + + eval '(exit $?0)' && eval 'exec perl -wS $0 ${1+"$@"}' + & eval 'exec /usr/bin/perl -wS $0 $argv:q' + if $running_under_some_shell; + +=begin original + +If the filename supplied contains directory separators (i.e., is an +absolute or relative pathname), and if that 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. + +=end original + +t@C¼ÉfBNgZp[^ªÜÜêÄ¢½ê +(ÂÜèâÎpXܽÍÎpX¾Á½ê)A»µÄ»Ìt@Cª +È©Á½êAt@Cg£qðÇÁ·évbgtH[ÅÍ +ÐƸÂg£qðÇÁµÄAt@CðTµÜ·B + +=begin original + +On DOS-like platforms, if the program does not contain directory +separators, it will first be searched for in the current directory +before being searched for on the PATH. On Unix platforms, the +program will be searched for strictly on the PATH. + +=end original + +DOS ÌvbgtH[ÅÍAvOÉfBNgZp[^ª +ÜÜêĢȩÁ½êAPATH ðT·OÉÅÉJgfBNgð +TµÜ·B +Unix vbgtH[ÅÍAvO͵§É PATH ©çÌÝ +T³êÜ·B + +=item B<-t> + +=begin original + +Like B<-T>, but taint checks will issue warnings rather than fatal +errors. These warnings can be controlled normally with C<no warnings +qw(taint)>. + +=end original + +B<-T> ƯlÅ·ªAõ`FbNÍv½IG[ÅÍÈxð +¶³¹Ü·B±ÌxÍÊíÊè C<no warnings qw(taint)>ŧäÅ«Ü·B + +=begin original + +B<NOTE: this is not a substitute for -T.> This is meant only to be +used as a temporary development aid while securing legacy code: +for real production code and for new secure code written from scratch +always use the real B<-T>. + +=end original + +B<Ó: ±êÍ -T ÌãpiÅÍ èܹñB> ±êÍ +ÌÌR[hðÀSÉ·éÌð¯é½ßÉêIÉgp³êé½ß¾¯ÌàÌÅ·: +{Ì»iÅR[hÆÅ©çÀSÈR[h̽ßÉÍ +íÉ{Ì B<-T> ðgÁľ³¢B + +=item B<-T> + +=begin original + +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 that run on behalf +of someone else whom you might not necessarily trust, such as CGI +programs or any internet servers you might write in Perl. See +L<perlsec> for details. 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 construct. + +=end original + +uõv`FbNðIɵÄAeXgÅ«éæ¤ÉµÜ·B +ÊíA±Ì`FbNÍ setuid â setgid ÌXNvgðÀs·éƫɾ¯A +sÈíêÜ·B +CGI vOâC^[lbgT[o[ð Perl ÅÆ«Ìæ¤ÉA +MpÅ«éÆÍÀçÈ¢lª®©·æ¤ÈvOÅÍ +±êð¾¦IÉLøÉ·éÌÍ¢¢l¦Å·B +Ú×É¢ÄÍ L<perlsec> ðQƵľ³¢B +ZL eBãÌR©çA±ÌIvVÍ Perl É©Èè +n³È¯êάèܹñB +±êÍÊíR}hCÌÅÌûɯé©A +#! \¢ÉηéVXeÅͱ±É©Å·B + +=item B<-u> + +=begin original + +This obsolete switch causes Perl to dump core after compiling your +program. You can then in theory take this core dump and turn it +into an executable file by using the B<undump> program (not supplied). +This speeds startup at the expense of some disk space (which you +can minimize by stripping the executable). (Still, a "hello world" +executable comes out to about 200K on my machine.) If you want to +execute a portion of your program before dumping, use the dump() +operator instead. Note: availability of B<undump> is platform +specific and may not be available for a specific port of Perl. + +=end original + +±ÌâXCb`ÍvOÌRpCãA +RA_vðsȤæ¤ÉµÜ·B +_IÉÍA±ÌRA_vðÁÄ«Ä(Perl ÌzzÅÍñ³êĢܹñª) +B<undump> vOðgÁÄAÀst@CÉÏ··é±ÆªÅ«Ü·B +±êͽfBXNeÊðH¢Ü·ª (Àst@Cð sprit ·é±ÆÅ +µÍ¸èÜ·)AÀsJnð¬·é±ÆªÅ«Ü·B +(¸çµÄàA"hello world" ÌÀst@CÍAÌ}VÅ 200K öÉ +ÈèÜ·B) +_v·éOɪIÉvOðÀsµÄ¨«½¢êÉÍA +±ÌXCb`ÌãíèÉ dump() ZqðgÁľ³¢B +Ó:B<undump> ªÀsÅ«éÌÍÁèÌ«ºÅ·µA +±êªg¦È¢ÚAo[WÌ Perl à éŵå¤B + +=begin original + +This switch has been superseded in favor of the new Perl code +generator backends to the compiler. See L<B> and L<B::Bytecode> +for details. + +=end original + +±ÌXCb`ÍRpCÌobNGhÆÈéVµ¢ Perl R[h +WFl[^Ì@\Éu«·¦çêĢܷB +Ú×É¢ÄÍ L<B> Æ L<B::Bytecode> ðQƵĺ³¢B + +=item B<-U> + +=begin original + +allows Perl to do unsafe operations. Currently the only "unsafe" +operations are the unlinking of directories while running as superuser, +and running setuid programs with fatal taint checks turned into +warnings. Note that the B<-w> switch (or the C<$^W> variable) must +be used along with this option to actually I<generate> the +taint-check warnings. + +=end original + +Perl ÉÀSÅÈ¢ìðµܷB +»ÝÌƱëAuÀSÅÈ¢vìÉÍA +X[p[[UƵÄÀsÉfBNgðí·é±ÆÆA +v½IÈõ`FbNðxÉÖ¦ÄA +setuid vOðÀs·é±ÆÅ·B +B<-w> XCb`( é¢Í C<$^W> Ï)Í +õ`FbNÌxªÀÛÉ I<¶¬³êé> ½ßÉ +±ÌIvVƤÉgíêȯêÎÈèܹñB + +=item B<-v> + +=begin original + +prints the version and patchlevel of your perl executable. + +=end original + +Perl Àst@CÌo[WÆpb`xð\¦µÜ·B + +=item B<-V> + +=begin original + +prints summary of the major perl configuration values and the current +values of @INC. + +=end original + +Perl ÌåÈÝèlÆ @INC Ì»ÝÌlð\¦µÜ·B + +=item B<-V:>I<name> + +=begin original + +Prints to STDOUT the value of the named configuration variable. +For example, + +=end original + +wè³ê½ÝèÏÌlð STDOUT É\¦µÜ·Bá¦Î: + + $ perl -V:man.dir + +=begin original + +will provide strong clues about what your MANPATH variable should +be set to in order to access the Perl documentation. + +=end original + +Í MANPATH «Ϫ Perl ÌhL gÉANZX·éÆ«É +ÇÌæ¤ÉZbg³êé׫©É¢ÄÍÈ誩èð^¦Ü·B + +=item B<-w> + +=begin original + +prints warnings about dubious constructs, such as variable names +that are mentioned only once and scalar variables that are used +before being set, redefined subroutines, references to undefined +filehandles or filehandles opened read-only that you are attempting +to write on, values used as a number that doesn't look like numbers, +using an array as though it were a scalar, if your subroutines +recurse more than 100 deep, and innumerable other things. + +=end original + +1 xµ©gíêȢϼAÝè³êéOÉgíêÄ¢éÏA +Tu[eBÌÄè`A¢è`Ìt@CnhÌQÆâA +read-only ÅI[vµ½t@CnhÖÌ«ÝA +lÉ©¦È¢lðlƵÄgÁ½êAzñð +XJÅ é©Ìæ¤ÉgÁ½êA +100 iKÈãÌTu[eBÌÄAA +»Ì¼½³ñÌ^íµ¢ÉxðoµÜ·B + +=begin original + +This switch really just enables the internal C<$^W> variable. You +can disable or promote into fatal errors specific warnings using +C<__WARN__> hooks, as described in L<perlvar> and L<perlfunc/warn>. +See also L<perldiag> and L<perltrap>. A new, fine-grained warning +facility is also available if you want to manipulate entire classes +of warnings; see L<warnings> or L<perllexwarn>. + +=end original + +±ÌXCb`ÍÀÛÉÍàÌ C<$^W> ÏðLøɷ龯ŷB +C<__WARN__> tbNðgÁÄÁèÌxð³øɵ½è +v½IG[ɵ½èÅ«Ü·B +±êÉ¢ÄÍ L<perlvar> Æ L<perlfunc/warn> ðQƵĺ³¢B +L<perldiag> Æ L<perltrap> àQƵĺ³¢B +àµxÌNXSÌðìµ½¢ÈçAVµ±xÌש¢ +x@\à èÜ·BL<warnings> â L<perllexwarn> ðQƵĺ³¢B + +=item B<-W> + +=begin original + +Enables all warnings regardless of C<no warnings> or C<$^W>. +See L<perllexwarn>. + +=end original + +C<no warnings> â C<$^W> ÌÝèÉÖíç¸SÄÌxðLøɵܷB +L<perllexwarn> ðQƵĺ³¢B + +=item B<-X> + +=begin original + +Disables all warnings regardless of C<use warnings> or C<$^W>. +See L<perllexwarn>. + +=end original + +C<use warnings> â C<$^W> ÌÝèÉÖíç¸SÄÌxð³øɵܷB +L<perllexwarn> ðQƵĺ³¢B + +=item B<-x> I<directory> + +=begin original + +tells Perl that the program is embedded in a larger chunk of unrelated +ASCII text, such as in a mail message. Leading garbage will be +discarded until the first line that starts with #! and contains the +string "perl". Any meaningful switches on that line will be applied. +If a directory name is specified, Perl will switch to that directory +before running the program. The B<-x> switch controls only the +disposal of leading garbage. The program must be terminated with +C<__END__> if there is trailing garbage to be ignored (the program +can process any or all of the trailing garbage via the DATA filehandle +if desired). + +=end original + +[Ìæ¤Èå«È³ÖWÌASCII eLXgÌ©½ÜèÌÉ +vOªßÜêÄ¢éð Perl ɽ¦Ü·B +ÅÌ #! ÅnÜèA"perl" Æ¢¤¶ñðÜÞsÜÅÌA +æs·éS~ÍÌÄçêÜ·B +»ÌsÉ éÓ¡ðÂXCb`ÍKp³êÜ·B +directory ªwè³êéÆAPerl ÍvOÌÀsOÉA +»ÌfBNgÉÚèÜ·B +C<-x> XCb`Íæs·éS~̪ð§ä·é¾¯Å·B +vOÌãɳ·×«S~ª éêÉÍA +C<__END__> ÅvOðI¹·éKvª èÜ· (»ÌAãɱ +S~ÌêܽÍSÍAKvÉ¶Ä DATA t@CnhðʵÄA +»ÌvOÅ·éªÅ«Ü·)B + +=back + +=head1 ENVIRONMENT + +(«Ï) + +=over 12 + +=item HOME + +=begin original + +Used if chdir has no argument. + +=end original + +chdir ÌøªÈ¢Æ«ÉgíêÜ·B + +=item LOGDIR + +=begin original + +Used if chdir has no argument and HOME is not set. + +=end original + +chdir ÌøªÈAHOME ªZbg³êĢȢƫÉgíêÜ·B + +=item PATH + +=begin original + +Used in executing subprocesses, and in finding the program if B<-S> is +used. + +=end original + +TuvZXðÀs·éÆ«ÆAB<-S> ªwè³ê½Æ«ÉvOð +T·ÌÉgíêÜ·B + +=item PERL5LIB + +=begin original + +A list of directories in which to look for Perl library +files before looking in the standard library and the current +directory. Any architecture-specific directories under the specified +locations are automatically included if they exist. If PERL5LIB is not +defined, PERLLIB is used. Directories are separated (like in PATH) by +a colon on unixish platforms and by a semicolon on Windows (the proper +path separator being given by the command C<perl -V:path_sep>). + +=end original + +Perl ÌCut@CðT·Æ«ÉWCufBNgÆ +JgfBNgðT·OÉT·fBNgÌXgÅ·B +ÁèÌêɨ¯éA[LeN`˶ÌfBNgÍ +ൠêΩ®IÉÇÁ³êÜ·B +PERL5LIB ªè`³êĢȯêÎAPERLLIB ªgíêÜ·B +fBNgÍ(PATH ƯlÉ)unix ÌvbgtH[ÅÍRÅæØçêA +Windows ÅÍZ~RÅæØçêÜ·(KØÈpXæØè¶Í +C<perl -V:path_sep> R}hÅí©èÜ·)B + +=begin original + +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: + +=end original + +(vOª setuid Ü½Í setgid ÅÀs³êÄ¢é©A +B<-T> XCb`ªwè³êÄ)õ`FbNt«Å®ìµÄ¢éêA +Ç¿çÌ«ÏàgíêܹñB +ãíèÉvOÅȺÌæ¤É·é׫ŷ: + + use lib "/my/directory"; + +=item PERL5OPT + +=begin original + +Command-line options (switches). Switches in this variable are taken +as if they were on every Perl command line. Only the B<-[DIMUdmtw]> +switches are allowed. When running taint checks (because the program +was running setuid or setgid, or the B<-T> switch was used), this +variable is ignored. If PERL5OPT begins with B<-T>, tainting will be +enabled, and any subsequent options ignored. + +=end original + +R}hCIvV(XCb`)Å·B +±ÌÏÌXCb`ÍSÄÌ Perl R}hCÅwè³ê½©Ìæ¤É +µíêÜ·B +B<-[DIMUdmtw]> IvVÌݪLøÅ·B +(vOª setuid Ü½Í setgid ÅÀs³êÄ¢é©A +B<-T> XCb`ªwè³êÄ)õ`FbNt«Å®ìµÄ¢éêA +±ÌÏͳ³êÜ·B +PERL5OPT ª B<-T> ÅnÜÁÄ¢éêA +õ`FbNªLøÆÈèAcèÌIvVͳ³êÜ·B + +=item PERLIO + +=begin original + +A space (or colon) separated list of PerlIO layers. If perl is built +to use PerlIO system for IO (the default) these layers effect perl's IO. + +=end original + +ó(ܽÍR)ÅæØçê½ PerlIO wÌXgÅ·B +perl ª IO É PerlIO VXeðg¤æ¤ÉRpC³êÄ¢éê +(±êªftHgÅ·)A±êçÌwª perl Ì IO Ée¿ð^¦Ü·B + +=begin original + +It is conventional to start layer names with a colon e.g. C<:perlio> to +emphasise their similarity to variable "attributes". But the code that parses +layer specification strings (which is also used to decode the PERLIO +environment variable) treats the colon as a separator. + +=end original + +Ï"®«"ÆÌÞ«ð²·é½ßÉw¼ð C<:perlio> Ìæ¤ÉRÅ +nßéµKª èÜ·Bµ©µvOÍwðè`·é¶ñÌp[X·é +(PERLIO «ÏÌfR[hÉàgíêÜ·)Æ«ÉRðZp[^ÆµÄ +µ¢Ü·B + +=begin original + +An unset or empty PERLIO is equivalent to C<:stdio>. + +=end original + +PERLIO ðZbgµÈ¢AܽÍó¶ñðZbg·éÆAC<:stdio> Æ¿Å·B + +=begin original + +The list becomes the default for I<all> perl's IO. Consequently only built-in +layers can appear in this list, as external layers (such as :encoding()) need +IO in order to load them!. See L<"open pragma"|open> for how to add external +encodings as defaults. + +=end original + +±ÌXgÍ I<SÄÌ> perl Ì IO ÌftHgÆÈèÜ·B +]ÁÄgÝÝÌwÌݪ±ÌXgÉLqÂ\Å·B +ȺÈç(:encoding() Ìæ¤È)OÇÝÝÌwÍ[h·é½ßÉ +IO ªKv¾©çÅ·BftHgƵÄOGR[fBOð +ÇÁ·éû@É¢ÄÍ L<"open pragma"|open> ðQƵľ³¢B + +=begin original + +The layers that it makes sense to include in the PERLIO environment +variable are briefly summarised below. For more details see L<PerlIO>. + +=end original + +PERLIO «ÏÉÁ¦é±ÆªÃÈwÌÈPÈêðȺɦµÜ·B +Ú×É¢ÄÍ L<PerlIO> ðQƵľ³¢B + +=over 8 + +=item :bytes + +=begin original + +A pseudolayer that turns I<off> the C<:utf8> flag for the layer below. +Unlikely to be useful on its own in the global PERLIO environment variable. +You perhaps were thinking of C<:crlf:bytes> or C<:perlio:bytes>. + +=end original + +Ⱥɦ· C<:utf8> tOð I<³øÉ·é> ½ßÌ[wÅ·B +O[oÈ PERLIO «ÏɱêðÜßé̪LpÈêÍ è»¤àȢŷB +¨»ç C<:crlf:bytes> © C<:perlio:bytes> ̱Æðl¦Ä¢éÌŵå¤B + +=item :crlf + +=begin original + +A layer which does CRLF to "\n" translation distinguishing "text" and +"binary" files in the manner of MS-DOS and similar operating systems. +(It currently does I<not> mimic MS-DOS as far as treating of Control-Z +as being an end-of-file marker.) + +=end original + +"eLXg"Æ"oCi"t@Cð¯Ê·é CRLF ©ç "\n" ÖÌÏ·ð +MS-DOS yѽæ¤ÈIy[eBOVXeÌû®Ås¤wÅ·B +(»ÝÌƱë Control-Z ðt@CÌIíèƩȷƱëÜÅ MS-DOS ð +ÜËÄܹ͢ñB) + +=item :mmap + +=begin original + +A layer which implements "reading" of files by using C<mmap()> to +make (whole) file appear in the process's address space, and then +using that as PerlIO's "buffer". + +=end original + +t@CÌ"ÇÝÝ"É C<mmap()> ðgÁÄt@C(SÌ)ð +vZXÌAhXóÔÉèÄA»êð PerlIO Ì"obt@"ÆµÄ +g¤½ßÌwÅ·B + +=item :perlio + +=begin original + +This is a re-implementation of "stdio-like" buffering written as a +PerlIO "layer". As such it will call whatever layer is below it for +its operations (typically C<:unix>). + +=end original + +±êÍ"stdio"Ìobt@Oð PerlIO "w" ƵÄÄÀµ½àÌÅ·B +]ÁÄÇÌæ¤Èw©çàìÉÄÑo³êÜ·(T^IÉÍ C<:unix>)B + +=item :pop + +=begin original + +An experimental pseudolayer that removes the topmost layer. +Use with the same care as is reserved for nitroglycerin. + +=end original + +æªÌwð·é½ßÌÀ±IÈ[wÅ·B +jgOZÉηéÌƯlÌTd³ðÁÄgÁľ³¢B + +=item :raw + +=begin original + +A pseudolayer that manipulates other layers. Applying the <:raw> +layer is equivalent to calling C<binmode($fh)>. It makes the stream +pass each byte as-is without any translation. In particular CRLF +translation, and/or :utf8 intuited from locale are disabled. + +=end original + +¼Ìwðì·é½ßÌ[wÅ·B C<:raw> wðKp·é±ÆÍ +C<binmode($fh)> ðÄÑo·ÌÆ¿Å·B +±êÍXg[ÌeoCgð½ÌÏ·àȵÉÊß³¹Ü·B +ÁÉ CRLF Ï·âP[©çÌ :utf8 ª³øÉÈèÜ·B + +=begin original + +Unlike in the earlier versions of Perl C<:raw> is I<not> +just the inverse of C<:crlf> - other layers which would affect the +binary nature of the stream are also removed or disabled. + +=end original + +ÌÌo[WÌ Perl ÆÙÈèAC<:raw> Í C<:crlf> Ìt +I<ÅÍ èܹñ> - Xg[ÌoCiÌ«¿Ée¿ð^¦é +»Ì¼Ìwà³ê驳øÉÈèÜ·B + +=item :stdio + +=begin original + +This layer provides PerlIO interface by wrapping system's ANSI C "stdio" +library calls. The layer provides both buffering and IO. +Note that C<:stdio> layer does I<not> do CRLF translation even if that +is platforms normal behaviour. You will need a C<:crlf> layer above it +to do that. + +=end original + +±ÌwÍVXeÌ ANSI C "stdio" CuR[ðbvµ½ +PerlIO C^[tF[XðñµÜ·B +±ÌwÍobt@OÆ IO ̼ûðñµÜ·B +C<:stdio> wÍ CRLF Ï·ð I<síÈ¢> ±ÆÉӵľ³¢B +½Æ¦»êªvbgtH[ÌÊíÌUé¢Å ÁÄàAÅ·B +±êðs¤½ßÉÍ C<:crlf> wªKvÅ·B + +=item :unix + +=begin original + +Low level layer which calls C<read>, C<write> and C<lseek> etc. + +=end original + +C<read>, C<write>, C<lseek> ÈÇðÄÑo·áxwÅ·B + +=item :utf8 + +=begin original + +A pseudolayer that turns on a flag on the layer below to tell perl +that output should be in utf8 and that input should be regarded as +already in utf8 form. May be useful in PERLIO environment +variable to make UTF-8 the default. (To turn off that behaviour +use C<:bytes> layer.) + +=end original + +oͪ utf8 ÅAüÍÍùÉ utf8 Ì`ÉÈÁÄ¢éƺÊÌwÉ`¦é +tOðIÉ·é[wÅ·BPERLIO «ÏÅ UTF-8 ªftHgÅ éÆ +Ýè³êÄ¢éêÉLp©àµêܹñB +(±ÌUé¢ðItÉ·é½ßÉÍ C<:bytes> wðgÁľ³¢B) + +=item :win32 + +=begin original + +On Win32 platforms this I<experimental> layer uses native "handle" IO +rather than unix-like numeric file descriptor layer. Known to be +buggy in this release. + +=end original + +Win32 vbgtH[ɨ¢ÄA±Ì I<À±I> wÍ +unix ÌlÌt@CLqqwÌãíèÉlCeBuÈ +"nh" IO ðgpµÜ·B +±Ì[XÅÍoOª é±Æªí©ÁĢܷB + +=back + +=begin original + +On all platforms the default set of layers should give acceptable results. + +=end original + +SÄÌvbgtH[ÅftHgÌwÌgÝí¹Í[¾Å«é +ÊÉÈÁÄ¢é͸ŷB + +=begin original + +For UNIX platforms that will equivalent of "unix perlio" or "stdio". +Configure is setup to prefer "stdio" implementation if system's library +provides for fast access to the buffer, otherwise it uses the "unix perlio" +implementation. + +=end original + +UNIX vbgtH[ÅͱêÍ "unix perlio" Ü½Í "stdio" Æ¿Å·B +configure XNvgÍVXeÌCuªobt@Ö̬ANZXû@ð +ñ·éêÍ"stdio"Àðg¤æ¤ÝèµA»¤ÅȯêÎ"unix perlio" +Àðg¢Ü·B + +=begin original + +On Win32 the default in this release is "unix crlf". Win32's "stdio" +has a number of bugs/mis-features for perl IO which are somewhat +C compiler vendor/version dependent. Using our own C<crlf> layer as +the buffer avoids those issues and makes things more uniform. +The C<crlf> layer provides CRLF to/from "\n" conversion as well as +buffering. + +=end original + +Win32 ÅÍftHgÍ"unix crlf"Å·B +Win32 Ì"stdio" Í perl IO ÉÆÁÄA +C RpCÌx_[/o[W˶ÌåÊÌoO/dlRêª èÜ·B +obt@ƵĩgÌ C<crlf> wðg¤±ÆűêçÌâèðñðµA +¨ðæèêѵ½àÌɵܷB +C<crlf> wÍobt@OÉ CRLF Æ "\n" ÌÏ·ðs¢Ü·B + +=begin original + +This release uses C<unix> as the bottom layer on Win32 and so still uses C +compiler's numeric file descriptor routines. There is an experimental native +C<win32> layer which is expected to be enhanced and should eventually be +the default under Win32. + +=end original + +±Ì[XÅÍ Win32 ÅÌîêwÆµÄ C<unix> ðg¤±ÆÅA +¢¾É C RpCÌlÌt@CLqq[`ðg¢Ü·B +g£ð\è³êÄ¢éÀ±IÈlCeBuÌ C<win32> wª èA +ÅIIÉÍ±êª Win32 ÅÌftHgÆÈé\èÅ·B + +=item PERLIO_DEBUG + +=begin original + +If set to the name of a file or device then certain operations of PerlIO +sub-system will be logged to that file (opened as append). Typical uses +are UNIX: + +=end original + +t@CܽÍfoCX̼OðZbg·éÆAPerlIO TuVXeÌ +¢Â©Ì쪻Ìt@CÉ(ÇL[hÅ)L^³êÜ·B +UNIX ÅÌT^IÈg¢ûÍȺÌÊèÅ·: + + PERLIO_DEBUG=/dev/tty perl script ... + +=begin original + +and Win32 approximate equivalent: + +=end original + +Win32 ÅÍȺªÙÚ¿Å·: + + set PERLIO_DEBUG=CON + perl script ... + + +=item PERLLIB + +=begin original + +A list of directories in which to look for Perl library +files before looking in the standard library and the current directory. +If PERL5LIB is defined, PERLLIB is not used. + +=end original + +Perl CuðT·ÌÉWCuÆJgfBNgÌOÉ +õ·éfBNgÌXgÅ·B +PERL5LIB ªè`³êÄ¢éÆAPERLLIB ÍgíêܹñB + +=item PERL5DB + +=begin original + +The command used to load the debugger code. The default is: + +=end original + +fobKR[hðÇÝÞÌÉgíêéR}hÅ·B +ftHgÍȺÌÊè: + + BEGIN { require 'perl5db.pl' } + +=item PERL5SHELL (specific to the Win32 port) + +=begin original + +May be set to an alternative shell that perl must use internally for +executing "backtick" commands or system(). Default is C<cmd.exe /x/d/c> +on WindowsNT and C<command.com /c> on Windows95. The value is considered +to be space-separated. Precede any character that needs to be protected +(like a space or backslash) with a backslash. + +=end original + +"obNNH[g" R}hâ system() ðÀs·é½ßÉ +Perl ªàIÉgíȯêÎÈçÈ¢ãÖVFðwèµÜ·B +ftHgÍ WindowsNT ÅÍ C<cmd.exe /x/d/c>AWindows95 ÅÍ +C<command.com /c> Å·B +lÍXy[XæØèÆl¦çêÜ·B +(óâobNXbV Ìæ¤È) Ûì·éKvª é¶ÌOÉÍ +obNXbV ªÂ¯çêÜ·B + +=begin original + +Note that Perl doesn't use COMSPEC for this purpose because +COMSPEC has a high degree of variability among users, leading to +portability concerns. Besides, perl can use a shell that may not be +fit for interactive use, and setting COMSPEC to such a shell may +interfere with the proper functioning of other programs (which usually +look in COMSPEC to find a shell fit for interactive use). + +=end original + +COMSPEC ÌlÍ[U[ÉæÁÄ©ÈèlXÅAÚA«Ìâèðø«N±·ÌÅA +Perl ͱÌÚIÉ COMSPEC ÍgíÈ¢±ÆÉӵľ³¢B +³çÉAPerl ÍÎbIÈprÉÍü©È¢VFàpÅ«Ü·ªA +COMSPEC É»Ìæ¤ÈVFðwè·éƼÌvO +(ÊÍÎbIÈprÉKµ½VFðT·ÌÉ COMSPEC ðg¢Ü·)ÌKØÈpð +×·é©àµêܹñB + +=item PERL_DEBUG_MSTATS + +=begin original + +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 +to an integer greater than one, also causes memory statistics to be dumped +after compilation. + +=end original + +Perl ª Perl zzpbP[WÉÜÜêé malloc [`ðgÁÄ +RpC³êÄ¢éê(C<perl -V:d_mymalloc> ª 'define' Ìê)ÉÌÝ +LøÅ·B +Ýè³êéÆAÀsãÉóµª\¦³êÜ·B +1 ð´¦élªÝè³êéÆARpCãÉà +óµð\¦µÜ·B + +=item PERL_DESTRUCT_LEVEL + +=begin original + +Relevant only if your perl executable was built with B<-DDEBUGGING>, +this controls the behavior of global destruction of objects and other +references. See L<perlhack/PERL_DESTRUCT_LEVEL> for more information. + +=end original + +Perl ÌÀst@Cª B<-DDEBUGGING> t«Å\z³ê½êÉÌÝLøÅ·B +±ÌIvVÍIuWFNgâ»Ì¼Ìt@XÌO[oÈ +fXgN^ÌUé¢ð§äµÜ·B³çÈéîñÉ¢ÄÍ +L<perlhack/PERL_DESTRUCT_LEVEL> ðQƵľ³¢B + +=item PERL_DL_NONLAZY + +=begin original + +Set to one to have perl resolve B<all> undefined symbols when it loads +a dynamic library. The default behaviour is to resolve symbols when +they are used. Setting this variable is useful during testing of +extensions as it ensures that you get an error on misspelled function +names even if the test suite doesn't call it. + +=end original + +1 ÉZbg·éÆA Perl Í B<SÄÌ> ¢è`V{ð_Ci~bNCuð +[hµ½Æ«ÉðµÜ·B +ftHgÌUé¢ÍgíêéÆ«ÉV{ððµÜ·B +±ÌÏðÝè·é±ÆÅAg£@\ÌeXgÉÖ¼ÌXy~Xð +eXgXC[gªÄÑo³ÈÄàG[ðmÀÉó¯æé±ÆªÅ«éÌÅ +ÖÅ·B + +=item PERL_ENCODING + +=begin original + +If using the C<encoding> pragma without an explicit encoding name, the +PERL_ENCODING environment variable is consulted for an encoding name. + +=end original + +C<encoding> vO}ð¾¦IÈGR[fBO¼ðwè¹¸É +gpµ½êAPERL_ENCODING «ϪGR[fBO¼ÆµÄgíêÜ·B + +=item PERL_HASH_SEED + +=begin original + +(Since Perl 5.8.1.) Used to randomise Perl's internal hash function. +To emulate the pre-5.8.1 behaviour, set to an integer (zero means +exactly the same order as 5.8.0). "Pre-5.8.1" means, among other +things, that hash keys will be ordered the same between different runs +of Perl. + +=end original + +(Perl 5.8.1 ©ç) Perl ÌànbV ÖÌ_»ÉgíêÜ·B +5.8.1 ÈOÌUé¢ðG~ [g·é½ßÉÍA®ðwèµÜ· +([Í 5.8.0 Æ®Sɯ¶ðÓ¡µÜ·)B +"5.8.1 ÈO" Æ¢¤ÌÍA»Ì¼Ì±ÆàÜßÄA +Perl ð½xÀsµÄànbV L[ÌÀѪ¯¶Å é±ÆðÓ¡µÜ·B + +=begin original + +The default behaviour is to randomise unless the PERL_HASH_SEED is set. +If Perl has been compiled with C<-DUSE_HASH_SEED_EXPLICIT>, the default +behaviour is B<not> to randomise unless the PERL_HASH_SEED is set. + +=end original + +ftHgÌUé¢ÍA PERL_HASH_SEED ªZbg³êÈ¢Àè +_»³êÜ·BPerl ª C<-DUSE_HASH_SEED_EXPLICIT> t«Å +RpC³ê½êAftHgÌUé¢Í +PERL_HASH_SEED ªZbg³êÈ¢Àè_» B<³êܹñ>B + +=begin original + +If PERL_HASH_SEED is unset or set to a non-numeric string, Perl uses +the pseudorandom seed supplied by the operating system and libraries. +This means that each different run of Perl will have a different +ordering of the results of keys(), values(), and each(). + +=end original + +PERL_HASH_SEED ªZbg³êÈ¢©AlÅÈ¢¶ñªZbg³ê½êA +Perl ÍIy[eBOVXeÆCuªñ·é[Ì +íðgpµÜ·B +±êÉæèAPerl ðÀs·éxÉ keys(), values(), each() ÌÊÌ +ªÏíèÜ·B + +=begin original + +B<Please note that the hash seed is sensitive information>. Hashes are +randomized to protect against local and remote attacks against Perl +code. By manually setting a seed this protection may be partially or +completely lost. + +=end original + +B<nbV ÌíÍ÷ÈâèÅ é±ÆÉӵľ³¢>B +nbV Í Perl R[hÉηé[JE[gU©ççé½ßÉ +_»³êÜ·Bè®ÅíðÝè·é±ÆÉæè±ÌçèͪIÉA + é¢Í®SɸíêÜ·B + +=begin original + +See L<perlsec/"Algorithmic Complexity Attacks"> and +L</PERL_HASH_SEED_DEBUG> for more information. + +=end original + +³çÈéîñÉ¢ÄÍ L<perlsec/"Algorithmic Complexity Attacks"> Æ +L</PERL_HASH_SEED_DEBUG> ðQƵľ³¢B + +=item PERL_HASH_SEED_DEBUG + +=begin original + +(Since Perl 5.8.1.) Set to one to display (to STDERR) the value of +the hash seed at the beginning of execution. This, combined with +L</PERL_HASH_SEED> is intended to aid in debugging nondeterministic +behavior caused by hash randomization. + +=end original + +(Perl 5.8.1 ©ç) ±êð 1 ÉÝè·éÆAÀsJnÉnbV ÌíÌ +lðæÊ(STDERR)Éo͵ܷB +±êÍ L</PERL_HASH_SEED> ÆgÝí¹é±ÆÅnbV Ì_»É +æéñèIÈUé¢ÌfobOð¯é±ÆðÚIƵĢܷB + +=begin original + +B<Note that the hash seed is sensitive information>: by knowing it one +can craft a denial-of-service attack against Perl code, even remotely, +see L<perlsec/"Algorithmic Complexity Attacks"> for more information. +B<Do not disclose the hash seed> to people who don't need to know it. +See also hash_seed() of L<Hash::Util>. + +=end original + +B<nbV ÌíÍ÷ÈâèÅ é±ÆÉӵľ³¢>: +±êðmé±ÆÅA[g©çÅà Perl ÌR[hÉεÄT[rXÛUð +d|¯é±ÆªoÜ·B³çÈéîñÉ¢ÄÍ +L<perlsec/"Algorithmic Complexity Attacks"> ðQƵľ³¢B +méKvÌÈ¢lXÉ뵀 B<nbV ÌíðöJµÈ¢Å¾³¢>B +L<Hash::Util> Ì hash_seed() àQƵľ³¢B + +=item PERL_ROOT (specific to the VMS port) + +=begin original + +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<perlvms> and in F<README.vms> in the Perl source distribution. + +=end original + +Perl Æ VMS êpÌ @INC ̽ßÌ_foCXðÜÞA +Ï·ªB³ê½[gÆÈé_¼Å·B +VMS Ì Perl Ée¿ð^¦é»Ì¼Ì_¼ÆµÄÍ +PERLSHR, PERL_ENV_TABLES, SYS$TIMEZONE_DIFFERENTIAL ª èÜ·ªA +±êçÍIvVÅ·BÚ×É¢ÄÍ +Perl \[XzzpbP[WÌ L<perlvms> Æ F<README.vms> Å +c_³êĢܷB + +=item PERL_SIGNALS + +=begin original + +In Perls 5.8.1 and later. If set to C<unsafe> the pre-Perl-5.8.0 +signals behaviour (immediate but unsafe) is restored. If set to +C<safe> the safe (or deferred) signals are used. +See L<perlipc/"Deferred Signals (Safe signals)">. + +=end original + +Perl 5.8.1 È~ÅLøÅ·B±êÉ C<unsafe> ðZbg·éÆ +Perl 5.8.0 ÈOÌVOiÌUé¢(¼ÚIÅ·ªÀSÅÍ èܹñ)ª +³³êÜ·BC<safe>ðZbg·éÆÀSÈ(x·é)VOiª +gíêÜ·B +L<perlipc/"Deferred Signals (Safe signals)">ðQƵľ³¢B + +=item PERL_UNICODE + +=begin original + +Equivalent to the B<-C> command-line switch. Note that this is not +a boolean variable-- setting this to C<"1"> is not the right way to +"enable Unicode" (whatever that would mean). You can use C<"0"> to +"disable Unicode", though (or alternatively unset PERL_UNICODE in +your shell before starting Perl). See the description of the C<-C> +switch for more information. + +=end original + +B<-C> R}hCXCb`Æ¿Å·B +±êÍ^UlÏÅÍÈ¢±ÆÉӵľ³¢ -- ±êð C<"1"> É +Zbg·é±ÆÍ(ÇñÈӡɨ¢Äà)"Unicode ðLøÉ·é"½ßÌ +³µ¢û@ÅÍ èܹñB +µ©µA"Unicode ð³øÉ·é"½ßÉ C<"0">ðZbg·é±ÆÍoÜ· +( é¢Í Perl ÌN®OÉ È½Ì¨g¢ÌVFÅ PERL_UNICODE ð +¢ÝèÉ·é±ÆÅàoÜ·)B +³çÈéîñÉ¢ÄÍ C<-C> XCb`Ìà¾ðQƵľ³¢B + +=item SYS$LOGIN (specific to the VMS port) + +=begin original + +Used if chdir has no argument and HOME and LOGDIR are not set. + +=end original + +chdir ÌøªÈAHOME Æ LOGDIR ªZbg³êĢȢƫÉgíêÜ·B + +=back + +=begin original + +Perl also has environment variables that control how Perl handles data +specific to particular natural languages. See L<perllocale>. + +=end original + +ÁèÌ©R¾êÉÁLÌf[^ð Perl ªÇÌæ¤Éµ¤©ð +§ä·é«Ïà èÜ·BL<perllocale> ðQƵĺ³¢B + +=begin original + +Apart from these, Perl uses no other environment variables, except +to make them available to the program being executed, and to child +processes. However, programs running setuid would do well to execute +the following lines before doing anything else, just to keep people +honest: + +=end original + +±êç̼ÉÍA +Às³êÄ¢évO é¢Í`ChvZXªªLøɵȢÀèA +Perl Í«Ïðg¢Ü¹ñB +µ©µAsetuid Å®ì·évOͽ©ð·éOÉA +PÉlXÉÏÈCðN±³¹È¢½ßÉ +ȺÌR[hðüêĨ̪æ¢Å·B + + $ENV{PATH} = '/bin:/usr/bin'; # or whatever you need + $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +=begin meta + +Translate: gº õl <JAE00****@nifty*****> +Update: Kentaro Shirakata <argra****@ub32*****> +License: GPL or Artistic + +=end meta