⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlvar.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 5 页
字号:
.SpUnder \s-1VMS\s0, \f(CW$^E\fR provides the \s-1VMS\s0 status value from the lastsystem error.  This is more specific information about the lastsystem error than that provided by \f(CW$!\fR.  This is particularlyimportant when \f(CW$!\fR is set to \fB\s-1EVMSERR\s0\fR..SpUnder \s-1OS/2\s0, \f(CW$^E\fR is set to the error code of the last call to\&\s-1OS/2\s0 \s-1API\s0 either via \s-1CRT\s0, or directly from perl..SpUnder Win32, \f(CW$^E\fR always returns the last error informationreported by the Win32 call \f(CW\*(C`GetLastError()\*(C'\fR which describesthe last error from within the Win32 \s-1API\s0.  Most Win32\-specificcode will report errors via \f(CW$^E\fR.  \s-1ANSI\s0 C and Unix-like callsset \f(CW\*(C`errno\*(C'\fR and so most portable Perl code will report errorsvia \f(CW$!\fR..SpCaveats mentioned in the description of \f(CW$!\fR generally apply to\&\f(CW$^E\fR, also.  (Mnemonic: Extra error explanation.).SpAlso see \*(L"Error Indicators\*(R"..ie n .IP "$EVAL_ERROR" 8.el .IP "\f(CW$EVAL_ERROR\fR" 8.IX Item "$EVAL_ERROR".PD 0.IP "$@" 8.IX Xref "$@ $EVAL_ERROR".PDThe Perl syntax error message from the last \fIeval()\fR operator.If $@ is the null string, the last \fIeval()\fR parsed and executedcorrectly (although the operations you invoked may have failed in thenormal fashion).  (Mnemonic: Where was the syntax error \*(L"at\*(R"?).SpWarning messages are not collected in this variable.  You can,however, set up a routine to process warnings by setting \f(CW$SIG{_\|_WARN_\|_}\fRas described below..SpAlso see \*(L"Error Indicators\*(R"..ie n .IP "$PROCESS_ID" 8.el .IP "\f(CW$PROCESS_ID\fR" 8.IX Item "$PROCESS_ID".PD 0.ie n .IP "$PID" 8.el .IP "\f(CW$PID\fR" 8.IX Item "$PID".IP "$$" 8.IX Xref "$$ $PID $PROCESS_ID".PDThe process number of the Perl running this script.  You shouldconsider this variable read-only, although it will be alteredacross \fIfork()\fR calls.  (Mnemonic: same as shells.).SpNote for Linux users: on Linux, the C functions \f(CW\*(C`getpid()\*(C'\fR and\&\f(CW\*(C`getppid()\*(C'\fR return different values from different threads. In order tobe portable, this behavior is not reflected by \f(CW$$\fR, whose value remainsconsistent across threads. If you want to call the underlying \f(CW\*(C`getpid()\*(C'\fR,you may use the \s-1CPAN\s0 module \f(CW\*(C`Linux::Pid\*(C'\fR..ie n .IP "$REAL_USER_ID" 8.el .IP "\f(CW$REAL_USER_ID\fR" 8.IX Item "$REAL_USER_ID".PD 0.ie n .IP "$UID" 8.el .IP "\f(CW$UID\fR" 8.IX Item "$UID".IP "$<" 8.IX Xref "$< $UID $REAL_USER_ID".PDThe real uid of this process.  (Mnemonic: it's the uid you came \fIfrom\fR,if you're running setuid.)  You can change both the real uid andthe effective uid at the same time by using \fIPOSIX::setuid()\fR.  Sincechanges to $< require a system call, check $! after a change attempt to detect any possible errors..ie n .IP "$EFFECTIVE_USER_ID" 8.el .IP "\f(CW$EFFECTIVE_USER_ID\fR" 8.IX Item "$EFFECTIVE_USER_ID".PD 0.ie n .IP "$EUID" 8.el .IP "\f(CW$EUID\fR" 8.IX Item "$EUID".IP "$>" 8.IX Xref "$> $EUID $EFFECTIVE_USER_ID".PDThe effective uid of this process.  Example:.Sp.Vb 2\&    $< = $>;            # set real to effective uid\&    ($<,$>) = ($>,$<);  # swap real and effective uid.Ve.SpYou can change both the effective uid and the real uid at the sametime by using \fIPOSIX::setuid()\fR.  Changes to $> require a check to $!to detect any possible errors after an attempted change..Sp(Mnemonic: it's the uid you went \fIto\fR, if you're running setuid.)\&\f(CW$<\fR and \f(CW$>\fR can be swapped only on machinessupporting \fIsetreuid()\fR..ie n .IP "$REAL_GROUP_ID" 8.el .IP "\f(CW$REAL_GROUP_ID\fR" 8.IX Item "$REAL_GROUP_ID".PD 0.ie n .IP "$GID" 8.el .IP "\f(CW$GID\fR" 8.IX Item "$GID".IP "$(" 8.IX Xref "$( $GID $REAL_GROUP_ID".PDThe real gid of this process.  If you are on a machine that supportsmembership in multiple groups simultaneously, gives a space separatedlist of groups you are in.  The first number is the one returned by\&\fIgetgid()\fR, and the subsequent ones by \fIgetgroups()\fR, one of which may bethe same as the first number..SpHowever, a value assigned to \f(CW$(\fR must be a single number used toset the real gid.  So the value given by \f(CW$(\fR should \fInot\fR be assignedback to \f(CW$(\fR without being forced numeric, such as by adding zero. Notethat this is different to the effective gid (\f(CW$)\fR) which does take alist..SpYou can change both the real gid and the effective gid at the sametime by using \fIPOSIX::setgid()\fR.  Changes to $( require a check to $!to detect any possible errors after an attempted change..Sp(Mnemonic: parentheses are used to \fIgroup\fR things.  The real gid is thegroup you \fIleft\fR, if you're running setgid.).ie n .IP "$EFFECTIVE_GROUP_ID" 8.el .IP "\f(CW$EFFECTIVE_GROUP_ID\fR" 8.IX Item "$EFFECTIVE_GROUP_ID".PD 0.ie n .IP "$EGID" 8.el .IP "\f(CW$EGID\fR" 8.IX Item "$EGID".IP "$)" 8.IX Xref "$) $EGID $EFFECTIVE_GROUP_ID".PDThe effective gid of this process.  If you are on a machine thatsupports membership in multiple groups simultaneously, gives a spaceseparated list of groups you are in.  The first number is the onereturned by \fIgetegid()\fR, and the subsequent ones by \fIgetgroups()\fR, one ofwhich may be the same as the first number..SpSimilarly, a value assigned to \f(CW$)\fR must also be a space-separatedlist of numbers.  The first number sets the effective gid, andthe rest (if any) are passed to \fIsetgroups()\fR.  To get the effect of anempty list for \fIsetgroups()\fR, just repeat the new effective gid; that is,to force an effective gid of 5 and an effectively empty \fIsetgroups()\fRlist, say \f(CW\*(C` $) = "5 5" \*(C'\fR..SpYou can change both the effective gid and the real gid at the sametime by using \fIPOSIX::setgid()\fR (use only a single numeric argument).Changes to $) require a check to $! to detect any possible errorsafter an attempted change..Sp(Mnemonic: parentheses are used to \fIgroup\fR things.  The effective gidis the group that's \fIright\fR for you, if you're running setgid.).Sp\&\f(CW$<\fR, \f(CW$>\fR, \f(CW$(\fR and \f(CW$)\fR can be set only onmachines that support the corresponding \fIset[re][ug]\fIid()\fI\fR routine.  \f(CW$(\fRand \f(CW$)\fR can be swapped only on machines supporting \fIsetregid()\fR..ie n .IP "$PROGRAM_NAME" 8.el .IP "\f(CW$PROGRAM_NAME\fR" 8.IX Item "$PROGRAM_NAME".PD 0.ie n .IP "$0" 8.el .IP "\f(CW$0\fR" 8.IX Xref "$0 $PROGRAM_NAME".IX Item "$0".PDContains the name of the program being executed..SpOn some (read: not all) operating systems assigning to \f(CW$0\fR modifiesthe argument area that the \f(CW\*(C`ps\*(C'\fR program sees.  On some platforms youmay have to use special \f(CW\*(C`ps\*(C'\fR options or a different \f(CW\*(C`ps\*(C'\fR to see thechanges.  Modifying the \f(CW$0\fR is more useful as a way of indicating thecurrent program state than it is for hiding the program you'rerunning.  (Mnemonic: same as \fBsh\fR and \fBksh\fR.).SpNote that there are platform specific limitations on the maximumlength of \f(CW$0\fR.  In the most extreme case it may be limited to thespace occupied by the original \f(CW$0\fR..SpIn some platforms there may be arbitrary amount of padding, forexample space characters, after the modified name as shown by \f(CW\*(C`ps\*(C'\fR.In some platforms this padding may extend all the way to the originallength of the argument area, no matter what you do (this is the casefor example with Linux 2.2)..SpNote for \s-1BSD\s0 users: setting \f(CW$0\fR does not completely remove \*(L"perl\*(R"from the \fIps\fR\|(1) output.  For example, setting \f(CW$0\fR to \f(CW"foobar"\fR mayresult in \f(CW"perl: foobar (perl)"\fR (whether both the \f(CW"perl: "\fR prefixand the \*(L" (perl)\*(R" suffix are shown depends on your exact \s-1BSD\s0 variantand version).  This is an operating system feature, Perl cannot help it..SpIn multithreaded scripts Perl coordinates the threads so that anythread may modify its copy of the \f(CW$0\fR and the change becomes visibleto \fIps\fR\|(1) (assuming the operating system plays along).  Note thatthe view of \f(CW$0\fR the other threads have will not change since theyhave their own copies of it..IP "$[" 8.IX Xref "$["The index of the first element in an array, and of the first characterin a substring.  Default is 0, but you could theoretically set itto 1 to make Perl behave more like \fBawk\fR (or Fortran) whensubscripting and when evaluating the \fIindex()\fR and \fIsubstr()\fR functions.(Mnemonic: [ begins subscripts.).SpAs of release 5 of Perl, assignment to \f(CW$[\fR is treated as a compilerdirective, and cannot influence the behavior of any other file.(That's why you can only assign compile-time constants to it.)Its use is highly discouraged..SpNote that, unlike other compile-time directives (such as strict),assignment to \f(CW$[\fR can be seen from outer lexical scopes in the same file.However, you can use \fIlocal()\fR on it to strictly bind its value to alexical block..IP "$]" 8.IX Xref "$]"The version + patchlevel / 1000 of the Perl interpreter.  This variablecan be used to determine whether the Perl interpreter executing ascript is in the right range of versions.  (Mnemonic: Is this versionof perl in the right bracket?)  Example:.Sp.Vb 1\&    warn "No checksumming!\en" if $] < 3.019;.Ve.SpSee also the documentation of \f(CW\*(C`use VERSION\*(C'\fR and \f(CW\*(C`require VERSION\*(C'\fRfor a convenient way to fail if the running Perl interpreter is too old..SpThe floating point representation can sometimes lead to inaccuratenumeric comparisons.  See \f(CW$^V\fR for a more modern representation ofthe Perl version that allows accurate string comparisons..ie n .IP "$COMPILING" 8.el .IP "\f(CW$COMPILING\fR" 8.IX Item "$COMPILING".PD 0.IP "$^C" 8.IX Xref "$^C $COMPILING".IX Item "$^C".PDThe current value of the flag associated with the \fB\-c\fR switch.Mainly of use with \fB\-MO=...\fR to allow code to alter its behaviorwhen being compiled, such as for example to \s-1AUTOLOAD\s0 at compiletime rather than normal, deferred loading.  Setting\&\f(CW\*(C`$^C = 1\*(C'\fR is similar to calling \f(CW\*(C`B::minus_c\*(C'\fR..ie n .IP "$DEBUGGING" 8.el .IP "\f(CW$DEBUGGING\fR" 8.IX Item "$DEBUGGING".PD 0.IP "$^D" 8.IX Xref "$^D $DEBUGGING".IX Item "$^D".PDThe current value of the debugging flags.  (Mnemonic: value of \fB\-D\fRswitch.) May be read or set. Like its command-line equivalent, you can usenumeric or symbolic values, eg \f(CW\*(C`$^D = 10\*(C'\fR or \f(CW\*(C`$^D = "st"\*(C'\fR..IP "${^RE_DEBUG_FLAGS}" 8.IX Item "${^RE_DEBUG_FLAGS}"The current value of the regex debugging flags. Set to 0 for no debug outputeven when the re 'debug' module is loaded. See re for details..IP "${^RE_TRIE_MAXBUF}" 8.IX Item "${^RE_TRIE_MAXBUF}"Controls how certain regex optimisations are applied and how much memory theyutilize. This value by default is 65536 which corresponds to a 512kB temporarycache. Set this to a higher value to trade memory for speed when matchinglarge alternations. Set it to a lower value if you want the optimisations tobe as conservative of memory as possible but still occur, and set it to anegative value to prevent the optimisation and conserve the most memory.Under normal situations this variable should be of no interest to you..ie n .IP "$SYSTEM_FD_MAX" 8.el .IP "\f(CW$SYSTEM_FD_MAX\fR" 8.IX Item "$SYSTEM_FD_MAX".PD 0.IP "$^F" 8.IX Xref "$^F $SYSTEM_FD_MAX".IX Item "$^F".PDThe maximum system file descriptor, ordinarily 2.  System filedescriptors are passed to \fIexec()\fRed processes, while higher filedescriptors are not.  Also, during an \fIopen()\fR, system file descriptors arepreserved even if the \fIopen()\fR fails.  (Ordinary file descriptors areclosed before the \fIopen()\fR is attempted.)  The close-on-execstatus of a file descriptor will be decided according to the value of\&\f(CW$^F\fR when the corresponding file, pipe, or socket was opened, not thetime of the \fIexec()\fR..IP "$^H" 8.IX Item "$^H"\&\s-1WARNING:\s0 This variable is strictly for internal use only.  Its availability,behavior, and contents are subject to change without notice..SpThis variable contains compile-time hints for the Perl interpreter.  At theend of compilation of a \s-1BLOCK\s0 the value of this variable is restored to thevalue when the interpreter started to compile the \s-1BLOCK\s0..SpWhen perl begins to parse any block construct that provides a lexical scope(e.g., eval body, required file, subroutine body, loop body, or conditionalblock), the existing value of $^H is saved, but its value is left unchanged.When the compilation of the block is completed, it regains the saved value.Between the points where its value is saved and restored, code thatexecutes within \s-1BEGIN\s0 blocks is free to change the value of $^H..SpThis behavior provides the semantic of lexical scoping, and is used in,for instance, the \f(CW\*(C`use strict\*(C'\fR pragma..SpThe contents should be an integer; different bits of it are used fordifferent pragmatic flags.  Here's an example:.Sp.Vb 1\&    sub add_100 { $^H |= 0x100 }\&\&    sub foo {\&        BEGIN { add_100() }\&        bar\->baz($boon);\&    }.Ve.SpConsider what happens during execution of the \s-1BEGIN\s0 block.  At this pointthe \s-1BEGIN\s0 block has already been compiled, but the body of \fIfoo()\fR is stillbeing compiled.  The new value of $^H will therefore be visible only whilethe body of \fIfoo()\fR is being compiled..SpSubstitution of the above \s-1BEGIN\s0 block with:.Sp.Vb 1\&    BEGIN { require strict; strict\->import(\*(Aqvars\*(Aq) }.Ve.Spdemonstrates how \f(CW\*(C`use strict \*(Aqvars\*(Aq\*(C'\fR is implemented.  Here's a conditionalversion of the same lexical pragma:.Sp.Vb 1\&    BEGIN { require strict; strict\->import(\*(Aqvars\*(Aq) if $condition }.Ve.IP "%^H" 8.IX Item "%^H"The %^H hash provides the same scoping semantic as $^H.  This makes ituseful for implementation of lexically scoped pragmas. See perlpragma..ie n .IP "$INPLACE_EDIT" 8.el .IP "\f(CW$INPLACE_EDIT\fR" 8.IX Item "$INPLACE_EDIT".PD 0.IP "$^I" 8.IX Xref "$^I $INPLACE_EDIT".IX Item "$^I".PDThe current value of the inplace-edit extension.  Use \f(CW\*(C`undef\*(C'\fR to disableinplace editing.  (Mnemonic: value of \fB\-i\fR switch.).IP "$^M" 8.IX Xref "$^M".IX Item "$^M"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -