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

📄 perlvar.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 5 页
字号:
it really means.Sp.Vb 1\&    $foo{join($;, $a, $b, $c)}.Ve.SpBut don't put.Sp.Vb 1\&    @foo{$a,$b,$c}      # a slice\-\-note the @.Ve.Spwhich means.Sp.Vb 1\&    ($foo{$a},$foo{$b},$foo{$c}).Ve.SpDefault is \*(L"\e034\*(R", the same as \s-1SUBSEP\s0 in \fBawk\fR.  If yourkeys contain binary data there might not be any safe value for \f(CW$;\fR.(Mnemonic: comma (the syntactic subscript separator) is asemi-semicolon.  Yeah, I know, it's pretty lame, but \f(CW$,\fR is alreadytaken for something more important.).SpConsider using \*(L"real\*(R" multidimensional arrays as describedin perllol..IP "\s-1HANDLE\-\s0>format_page_number(\s-1EXPR\s0)" 8.IX Item "HANDLE->format_page_number(EXPR)".PD 0.ie n .IP "$FORMAT_PAGE_NUMBER" 8.el .IP "\f(CW$FORMAT_PAGE_NUMBER\fR" 8.IX Item "$FORMAT_PAGE_NUMBER".IP "$%" 8.IX Xref "$% $FORMAT_PAGE_NUMBER".PDThe current page number of the currently selected output channel.Used with formats.(Mnemonic: % is page number in \fBnroff\fR.).IP "\s-1HANDLE\-\s0>format_lines_per_page(\s-1EXPR\s0)" 8.IX Item "HANDLE->format_lines_per_page(EXPR)".PD 0.ie n .IP "$FORMAT_LINES_PER_PAGE" 8.el .IP "\f(CW$FORMAT_LINES_PER_PAGE\fR" 8.IX Item "$FORMAT_LINES_PER_PAGE".IP "$=" 8.IX Xref "$= $FORMAT_LINES_PER_PAGE".PDThe current page length (printable lines) of the currently selectedoutput channel.  Default is 60.  Used with formats.(Mnemonic: = has horizontal lines.).IP "\s-1HANDLE\-\s0>format_lines_left(\s-1EXPR\s0)" 8.IX Item "HANDLE->format_lines_left(EXPR)".PD 0.ie n .IP "$FORMAT_LINES_LEFT" 8.el .IP "\f(CW$FORMAT_LINES_LEFT\fR" 8.IX Item "$FORMAT_LINES_LEFT".IP "$\-" 8.IX Xref "$- $FORMAT_LINES_LEFT".PDThe number of lines left on the page of the currently selected outputchannel.  Used with formats.(Mnemonic: lines_on_page \- lines_printed.).ie n .IP "@LAST_MATCH_START" 8.el .IP "\f(CW@LAST_MATCH_START\fR" 8.IX Item "@LAST_MATCH_START".PD 0.IP "@\-" 8.IX Xref "@- @LAST_MATCH_START".PD$\-[0] is the offset of the start of the last successful match.\&\f(CW\*(C`$\-[\*(C'\fR\fIn\fR\f(CW\*(C`]\*(C'\fR is the offset of the start of the substring matched by\&\fIn\fR\-th subpattern, or undef if the subpattern did not match..SpThus after a match against \f(CW$_\fR, $& coincides with \f(CW\*(C`substr $_, $\-[0],$+[0] \- $\-[0]\*(C'\fR.  Similarly, $\fIn\fR coincides with \f(CW\*(C`substr $_, $\-[n],$+[n] \- $\-[n]\*(C'\fR if \f(CW\*(C`$\-[n]\*(C'\fR is defined, and $+ coincides with\&\f(CW\*(C`substr $_, $\-[$#\-], $+[$#\-] \- $\-[$#\-]\*(C'\fR.  One can use \f(CW\*(C`$#\-\*(C'\fR to find the lastmatched subgroup in the last successful match.  Contrast with\&\f(CW$#+\fR, the number of subgroups in the regular expression.  Comparewith \f(CW\*(C`@+\*(C'\fR..SpThis array holds the offsets of the beginnings of the lastsuccessful submatches in the currently active dynamic scope.\&\f(CW\*(C`$\-[0]\*(C'\fR is the offset into the string of the beginning of theentire match.  The \fIn\fRth element of this array holds the offsetof the \fIn\fRth submatch, so \f(CW\*(C`$\-[1]\*(C'\fR is the offset where \f(CW$1\fRbegins, \f(CW\*(C`$\-[2]\*(C'\fR the offset where \f(CW$2\fR begins, and so on..SpAfter a match against some variable \f(CW$var:\fR.RS 8.ie n .IP """$\`""\fR is the same as \f(CW""substr($var, 0, $\-[0])""" 5.el .IP "\f(CW$\`\fR is the same as \f(CWsubstr($var, 0, $\-[0])\fR" 5.IX Item "$ is the same as substr($var, 0, $-[0])".PD 0.ie n .IP "$&\fR is the same as \f(CW""substr($var, $\-[0], $+[0] \- $\-[0])""" 5.el .IP "\f(CW$&\fR is the same as \f(CWsubstr($var, $\-[0], $+[0] \- $\-[0])\fR" 5.IX Item "$& is the same as substr($var, $-[0], $+[0] - $-[0])".ie n .IP """$\*(Aq""\fR is the same as \f(CW""substr($var, $+[0])""" 5.el .IP "\f(CW$\*(Aq\fR is the same as \f(CWsubstr($var, $+[0])\fR" 5.IX Item "$ is the same as substr($var, $+[0])".ie n .IP "$1\fR is the same as \f(CW""substr($var, $\-[1], $+[1] \- $\-[1])""" 5.el .IP "\f(CW$1\fR is the same as \f(CWsubstr($var, $\-[1], $+[1] \- $\-[1])\fR" 5.IX Item "$1 is the same as substr($var, $-[1], $+[1] - $-[1])".ie n .IP "$2\fR is the same as \f(CW""substr($var, $\-[2], $+[2] \- $\-[2])""" 5.el .IP "\f(CW$2\fR is the same as \f(CWsubstr($var, $\-[2], $+[2] \- $\-[2])\fR" 5.IX Item "$2 is the same as substr($var, $-[2], $+[2] - $-[2])".ie n .IP "$3\fR is the same as \f(CW""substr($var, $\-[3], $+[3] \- $\-[3])""" 5.el .IP "\f(CW$3\fR is the same as \f(CWsubstr($var, $\-[3], $+[3] \- $\-[3])\fR" 5.IX Item "$3 is the same as substr($var, $-[3], $+[3] - $-[3])".RE.RS 8.RE.IP "%\-" 8.IX Xref "%-".PDSimilar to \f(CW\*(C`%+\*(C'\fR, this variable allows access to the named capture buffersin the last successful match in the currently active dynamic scope. Toeach capture buffer name found in the regular expression, it associates areference to an array containing the list of values captured by allbuffers with that name (should there be several of them), in the orderwhere they appear..SpHere's an example:.Sp.Vb 10\&    if (\*(Aq1234\*(Aq =~ /(?<A>1)(?<B>2)(?<A>3)(?<B>4)/) {\&        foreach my $bufname (sort keys %\-) {\&            my $ary = $\-{$bufname};\&            foreach my $idx (0..$#$ary) {\&                print "\e$\-{$bufname}[$idx] : ",\&                      (defined($ary\->[$idx]) ? "\*(Aq$ary\->[$idx]\*(Aq" : "undef"),\&                      "\en";\&            }\&        }\&    }.Ve.Spwould print out:.Sp.Vb 4\&    $\-{A}[0] : \*(Aq1\*(Aq\&    $\-{A}[1] : \*(Aq3\*(Aq\&    $\-{B}[0] : \*(Aq2\*(Aq\&    $\-{B}[1] : \*(Aq4\*(Aq.Ve.SpThe keys of the \f(CW\*(C`%\-\*(C'\fR hash correspond to all buffer names found inthe regular expression..SpThe behaviour of \f(CW\*(C`%\-\*(C'\fR is implemented via theTie::Hash::NamedCapture module..Sp\&\fBNote:\fR \f(CW\*(C`%\-\*(C'\fR and \f(CW\*(C`%+\*(C'\fR are tied views into a common internal hashassociated with the last successful regular expression. Therefore mixingiterative access to them via \f(CW\*(C`each\*(C'\fR may have unpredictable results.Likewise, if the last successful match changes, then the results may besurprising..IP "\s-1HANDLE\-\s0>format_name(\s-1EXPR\s0)" 8.IX Item "HANDLE->format_name(EXPR)".PD 0.ie n .IP "$FORMAT_NAME" 8.el .IP "\f(CW$FORMAT_NAME\fR" 8.IX Item "$FORMAT_NAME".IP "$~" 8.IX Xref "$~ $FORMAT_NAME".PDThe name of the current report format for the currently selected outputchannel.  Default is the name of the filehandle.  (Mnemonic: brother to\&\f(CW$^\fR.).IP "\s-1HANDLE\-\s0>format_top_name(\s-1EXPR\s0)" 8.IX Item "HANDLE->format_top_name(EXPR)".PD 0.ie n .IP "$FORMAT_TOP_NAME" 8.el .IP "\f(CW$FORMAT_TOP_NAME\fR" 8.IX Item "$FORMAT_TOP_NAME".IP "$^" 8.IX Xref "$^ $FORMAT_TOP_NAME".PDThe name of the current top-of-page format for the currently selectedoutput channel.  Default is the name of the filehandle with _TOPappended.  (Mnemonic: points to top of page.).IP "IO::Handle\->format_line_break_characters \s-1EXPR\s0" 8.IX Item "IO::Handle->format_line_break_characters EXPR".PD 0.ie n .IP "$FORMAT_LINE_BREAK_CHARACTERS" 8.el .IP "\f(CW$FORMAT_LINE_BREAK_CHARACTERS\fR" 8.IX Item "$FORMAT_LINE_BREAK_CHARACTERS".ie n .IP "$:" 8.el .IP "\f(CW$:\fR" 8.IX Xref "$: FORMAT_LINE_BREAK_CHARACTERS".IX Item "$:".PDThe current set of characters after which a string may be broken tofill continuation fields (starting with ^) in a format.  Default is\&\*(L"\ \en\-\*(R", to break on whitespace or hyphens.  (Mnemonic: a \*(L"colon\*(R" inpoetry is a part of a line.).IP "IO::Handle\->format_formfeed \s-1EXPR\s0" 8.IX Item "IO::Handle->format_formfeed EXPR".PD 0.ie n .IP "$FORMAT_FORMFEED" 8.el .IP "\f(CW$FORMAT_FORMFEED\fR" 8.IX Item "$FORMAT_FORMFEED".IP "$^L" 8.IX Xref "$^L $FORMAT_FORMFEED".IX Item "$^L".PDWhat formats output as a form feed.  Default is \ef..ie n .IP "$ACCUMULATOR" 8.el .IP "\f(CW$ACCUMULATOR\fR" 8.IX Item "$ACCUMULATOR".PD 0.IP "$^A" 8.IX Xref "$^A $ACCUMULATOR".IX Item "$^A".PDThe current value of the \fIwrite()\fR accumulator for \fIformat()\fR lines.  A formatcontains \fIformline()\fR calls that put their result into \f(CW$^A\fR.  Aftercalling its format, \fIwrite()\fR prints out the contents of \f(CW$^A\fR and empties.So you never really see the contents of \f(CW$^A\fR unless you call\&\fIformline()\fR yourself and then look at it.  See perlform and\&\*(L"\fIformline()\fR\*(R" in perlfunc..ie n .IP "$CHILD_ERROR" 8.el .IP "\f(CW$CHILD_ERROR\fR" 8.IX Item "$CHILD_ERROR".PD 0.IP "$?" 8.IX Xref "$? $CHILD_ERROR".PDThe status returned by the last pipe close, backtick (\f(CW\*(C`\`\`\*(C'\fR) command,successful call to \fIwait()\fR or \fIwaitpid()\fR, or from the \fIsystem()\fRoperator.  This is just the 16\-bit status word returned by thetraditional Unix \fIwait()\fR system call (or else is made up to look like it).  Thus, theexit value of the subprocess is really (\f(CW\*(C`$? >> 8\*(C'\fR), and\&\f(CW\*(C`$? & 127\*(C'\fR gives which signal, if any, the process died from, and\&\f(CW\*(C`$? & 128\*(C'\fR reports whether there was a core dump.  (Mnemonic:similar to \fBsh\fR and \fBksh\fR.).SpAdditionally, if the \f(CW\*(C`h_errno\*(C'\fR variable is supported in C, its valueis returned via $? if any \f(CW\*(C`gethost*()\*(C'\fR function fails..SpIf you have installed a signal handler for \f(CW\*(C`SIGCHLD\*(C'\fR, thevalue of \f(CW$?\fR will usually be wrong outside that handler..SpInside an \f(CW\*(C`END\*(C'\fR subroutine \f(CW$?\fR contains the value that is going to begiven to \f(CW\*(C`exit()\*(C'\fR.  You can modify \f(CW$?\fR in an \f(CW\*(C`END\*(C'\fR subroutine tochange the exit status of your program.  For example:.Sp.Vb 3\&    END {\&        $? = 1 if $? == 255;  # die would make it 255\&    }.Ve.SpUnder \s-1VMS\s0, the pragma \f(CW\*(C`use vmsish \*(Aqstatus\*(Aq\*(C'\fR makes \f(CW$?\fR reflect theactual \s-1VMS\s0 exit status, instead of the default emulation of \s-1POSIX\s0status; see \*(L"$?\*(R" in perlvms for details..SpAlso see \*(L"Error Indicators\*(R"..IP "${^CHILD_ERROR_NATIVE}" 8.IX Xref "$^CHILD_ERROR_NATIVE".IX Item "${^CHILD_ERROR_NATIVE}"The native status returned by the last pipe close, backtick (\f(CW\*(C`\`\`\*(C'\fR)command, successful call to \fIwait()\fR or \fIwaitpid()\fR, or from the \fIsystem()\fRoperator.  On POSIX-like systems this value can be decoded with the\&\s-1WIFEXITED\s0, \s-1WEXITSTATUS\s0, \s-1WIFSIGNALED\s0, \s-1WTERMSIG\s0, \s-1WIFSTOPPED\s0, \s-1WSTOPSIG\s0and \s-1WIFCONTINUED\s0 functions provided by the \s-1POSIX\s0 module..SpUnder \s-1VMS\s0 this reflects the actual \s-1VMS\s0 exit status; i.e. it is the sameas $? when the pragma \f(CW\*(C`use vmsish \*(Aqstatus\*(Aq\*(C'\fR is in effect..IP "${^ENCODING}" 8.IX Xref "$^ENCODING".IX Item "${^ENCODING}"The \fIobject reference\fR to the Encode object that is used to convertthe source code to Unicode.  Thanks to this variable your perl scriptdoes not have to be written in \s-1UTF\-8\s0.  Default is \fIundef\fR.  The directmanipulation of this variable is highly discouraged..ie n .IP "$OS_ERROR" 8.el .IP "\f(CW$OS_ERROR\fR" 8.IX Item "$OS_ERROR".PD 0.ie n .IP "$ERRNO" 8.el .IP "\f(CW$ERRNO\fR" 8.IX Item "$ERRNO".IP "$!" 8.IX Xref "$! $ERRNO $OS_ERROR".PDIf used numerically, yields the current value of the C \f(CW\*(C`errno\*(C'\fRvariable, or in other words, if a system or library call fails, itsets this variable.  This means that the value of \f(CW$!\fR is meaningfulonly \fIimmediately\fR after a \fBfailure\fR:.Sp.Vb 10\&    if (open(FH, $filename)) {\&        # Here $! is meaningless.\&        ...\&    } else {\&        # ONLY here is $! meaningful.\&        ...\&        # Already here $! might be meaningless.\&    }\&    # Since here we might have either success or failure,\&    # here $! is meaningless..Ve.SpIn the above \fImeaningless\fR stands for anything: zero, non-zero,\&\f(CW\*(C`undef\*(C'\fR.  A successful system or library call does \fBnot\fR setthe variable to zero..SpIf used as a string, yields the corresponding system error string.You can assign a number to \f(CW$!\fR to set \fIerrno\fR if, for instance,you want \f(CW"$!"\fR to return the string for error \fIn\fR, or you wantto set the exit value for the \fIdie()\fR operator.  (Mnemonic: What justwent bang?).SpAlso see \*(L"Error Indicators\*(R"..ie n .IP "%OS_ERROR" 8.el .IP "\f(CW%OS_ERROR\fR" 8.IX Item "%OS_ERROR".PD 0.ie n .IP "%ERRNO" 8.el .IP "\f(CW%ERRNO\fR" 8.IX Item "%ERRNO".IP "%!" 8.IX Xref "%!".PDEach element of \f(CW\*(C`%!\*(C'\fR has a true value only if \f(CW$!\fR is set to thatvalue.  For example, \f(CW$!{ENOENT}\fR is true if and only if the currentvalue of \f(CW$!\fR is \f(CW\*(C`ENOENT\*(C'\fR; that is, if the most recent error was\&\*(L"No such file or directory\*(R" (or its moral equivalent: not all operatingsystems give that exact error, and certainly not all languages).To check if a particular key is meaningful on your system, use\&\f(CW\*(C`exists $!{the_key}\*(C'\fR; for a list of legal keys, use \f(CW\*(C`keys %!\*(C'\fR.See Errno for more information, and also see above for thevalidity of \f(CW$!\fR..ie n .IP "$EXTENDED_OS_ERROR" 8.el .IP "\f(CW$EXTENDED_OS_ERROR\fR" 8.IX Item "$EXTENDED_OS_ERROR".PD 0.IP "$^E" 8.IX Xref "$^E $EXTENDED_OS_ERROR".IX Item "$^E".PDError information specific to the current operating system.  Atthe moment, this differs from \f(CW$!\fR under only \s-1VMS\s0, \s-1OS/2\s0, and Win32(and for MacPerl).  On all other platforms, \f(CW$^E\fR is always justthe same as \f(CW$!\fR.

⌨️ 快捷键说明

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