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

📄 perldata.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 3 页
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "PERLDATA 1".TH PERLDATA 1 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"perldata \- Perl data types.SH "DESCRIPTION".IX Header "DESCRIPTION".Sh "Variable names".IX Xref "variable, name variable name data type type".IX Subsection "Variable names"Perl has three built-in data types: scalars, arrays of scalars, andassociative arrays of scalars, known as \*(L"hashes\*(R".  A scalar is a single string (of any size, limited only by the available memory),number, or a reference to something (which will be discussedin perlref).  Normal arrays are ordered lists of scalars indexedby number, starting with 0.  Hashes are unordered collections of scalar values indexed by their associated string key..PPValues are usually referred to by name, or through a named reference.The first character of the name tells you to what sort of datastructure it refers.  The rest of the name tells you the particularvalue to which it refers.  Usually this name is a single \fIidentifier\fR,that is, a string beginning with a letter or underscore, andcontaining letters, underscores, and digits.  In some cases, it maybe a chain of identifiers, separated by \f(CW\*(C`::\*(C'\fR (or by the slightlyarchaic \f(CW\*(C`\*(Aq\*(C'\fR); all but the last are interpreted as names of packages,to locate the namespace in which to look up the final identifier(see \*(L"Packages\*(R" in perlmod for details).  It's possible to substitutefor a simple identifier, an expression that produces a referenceto the value at runtime.   This is described in more detail belowand in perlref..IX Xref "identifier".PPPerl also has its own built-in variables whose names don't followthese rules.  They have strange names so they don't accidentallycollide with one of your normal variables.  Strings that matchparenthesized parts of a regular expression are saved under namescontaining only digits after the \f(CW\*(C`$\*(C'\fR (see perlop and perlre).In addition, several special variables that provide windows intothe inner working of Perl have names containing punctuation charactersand control characters.  These are documented in perlvar..IX Xref "variable, built-in".PPScalar values are always named with '$', even when referring to ascalar that is part of an array or a hash.  The '$' symbol workssemantically like the English word \*(L"the\*(R" in that it indicates asingle value is expected..IX Xref "scalar".PP.Vb 4\&    $days               # the simple scalar value "days"\&    $days[28]           # the 29th element of array @days\&    $days{\*(AqFeb\*(Aq}        # the \*(AqFeb\*(Aq value from hash %days\&    $#days              # the last index of array @days.Ve.PPEntire arrays (and slices of arrays and hashes) are denoted by '@',which works much like the word \*(L"these\*(R" or \*(L"those\*(R" does in English,in that it indicates multiple values are expected..IX Xref "array".PP.Vb 3\&    @days               # ($days[0], $days[1],... $days[n])\&    @days[3,4,5]        # same as ($days[3],$days[4],$days[5])\&    @days{\*(Aqa\*(Aq,\*(Aqc\*(Aq}      # same as ($days{\*(Aqa\*(Aq},$days{\*(Aqc\*(Aq}).Ve.PPEntire hashes are denoted by '%':.IX Xref "hash".PP.Vb 1\&    %days               # (key1, val1, key2, val2 ...).Ve.PPIn addition, subroutines are named with an initial '&', though thisis optional when unambiguous, just as the word \*(L"do\*(R" is often redundantin English.  Symbol table entries can be named with an initial '*',but you don't really care about that yet (if ever :\-)..PPEvery variable type has its own namespace, as do severalnon-variable identifiers.  This means that you can, without fearof conflict, use the same name for a scalar variable, an array, ora hash\*(--or, for that matter, for a filehandle, a directory handle, asubroutine name, a format name, or a label.  This means that \f(CW$foo\fRand \f(CW@foo\fR are two different variables.  It also means that \f(CW$foo[1]\fRis a part of \f(CW@foo\fR, not a part of \f(CW$foo\fR.  This may seem a bit weird,but that's okay, because it is weird..IX Xref "namespace".PPBecause variable references always start with '$', '@', or '%', the\&\*(L"reserved\*(R" words aren't in fact reserved with respect to variablenames.  They \fIare\fR reserved with respect to labels and filehandles,however, which don't have an initial special character.  You can'thave a filehandle named \*(L"log\*(R", for instance.  Hint: you could say\&\f(CW\*(C`open(LOG,\*(Aqlogfile\*(Aq)\*(C'\fR rather than \f(CW\*(C`open(log,\*(Aqlogfile\*(Aq)\*(C'\fR.  Usinguppercase filehandles also improves readability and protects youfrom conflict with future reserved words.  Case \fIis\fR significant\-\-\*(L"\s-1FOO\s0\*(R",\&\*(L"Foo\*(R", and \*(L"foo\*(R" are all different names.  Names that start with aletter or underscore may also contain digits and underscores..IX Xref "identifier, case sensitivity case".PPIt is possible to replace such an alphanumeric name with an expressionthat returns a reference to the appropriate type.  For a descriptionof this, see perlref..PPNames that start with a digit may contain only more digits.  Namesthat do not start with a letter, underscore, digit or a caret (i.e.a control character) are limited to one character, e.g.,  \f(CW$%\fR or\&\f(CW$$\fR.  (Most of these one character names have a predefinedsignificance to Perl.  For instance, \f(CW$$\fR is the current processid.).Sh "Context".IX Xref "context scalar context list context".IX Subsection "Context"The interpretation of operations and values in Perl sometimes dependson the requirements of the context around the operation or value.There are two major contexts: list and scalar.  Certain operationsreturn list values in contexts wanting a list, and scalar valuesotherwise.  If this is true of an operation it will be mentioned inthe documentation for that operation.  In other words, Perl overloadscertain operations based on whether the expected return value issingular or plural.  Some words in English work this way, like \*(L"fish\*(R"and \*(L"sheep\*(R"..PPIn a reciprocal fashion, an operation provides either a scalar or alist context to each of its arguments.  For example, if you say.PP.Vb 1\&    int( <STDIN> ).Ve.PPthe integer operation provides scalar context for the <>operator, which responds by reading one line from \s-1STDIN\s0 and passing itback to the integer operation, which will then find the integer valueof that line and return that.  If, on the other hand, you say.PP.Vb 1\&    sort( <STDIN> ).Ve.PPthen the sort operation provides list context for <>, whichwill proceed to read every line available up to the end of file, andpass that list of lines back to the sort routine, which will thensort those lines and return them as a list to whatever the contextof the sort was..PPAssignment is a little bit special in that it uses its left argumentto determine the context for the right argument.  Assignment to ascalar evaluates the right-hand side in scalar context, whileassignment to an array or hash evaluates the righthand side in listcontext.  Assignment to a list (or slice, which is just a listanyway) also evaluates the righthand side in list context..PPWhen you use the \f(CW\*(C`use warnings\*(C'\fR pragma or Perl's \fB\-w\fR command-line option, you may see warningsabout useless uses of constants or functions in \*(L"void context\*(R".Void context just means the value has been discarded, such as astatement containing only \f(CW\*(C`"fred";\*(C'\fR or \f(CW\*(C`getpwuid(0);\*(C'\fR.  It stillcounts as scalar context for functions that care whether or notthey're being called in list context..PPUser-defined subroutines may choose to care whether they are beingcalled in a void, scalar, or list context.  Most subroutines do notneed to bother, though.  That's because both scalars and lists areautomatically interpolated into lists.  See \*(L"wantarray\*(R" in perlfuncfor how you would dynamically discern your function's callingcontext..Sh "Scalar values".IX Xref "scalar number string reference".IX Subsection "Scalar values"All data in Perl is a scalar, an array of scalars, or a hash ofscalars.  A scalar may contain one single value in any of threedifferent flavors: a number, a string, or a reference.  In general,conversion from one form to another is transparent.  Although ascalar may not directly hold multiple values, it may contain areference to an array or hash which in turn contains multiple values..PPScalars aren't necessarily one thing or another.  There's no placeto declare a scalar variable to be of type \*(L"string\*(R", type \*(L"number\*(R",type \*(L"reference\*(R", or anything else.  Because of the automaticconversion of scalars, operations that return scalars don't needto care (and in fact, cannot care) whether their caller is lookingfor a string, a number, or a reference.  Perl is a contextuallypolymorphic language whose scalars can be strings, numbers, orreferences (which includes objects).  Although strings and numbersare considered pretty much the same thing for nearly all purposes,references are strongly-typed, uncastable pointers with builtinreference-counting and destructor invocation..PPA scalar value is interpreted as \s-1TRUE\s0 in the Boolean sense if it is notthe null string or the number 0 (or its string equivalent, \*(L"0\*(R").  TheBoolean context is just a special kind of scalar context where no conversion to a string or a number is ever performed..IX Xref "boolean bool true false truth".PPThere are actually two varieties of null strings (sometimes referredto as \*(L"empty\*(R" strings), a defined one and an undefined one.  Thedefined version is just a string of length zero, such as \f(CW""\fR.The undefined version is the value that indicates that there isno real value for something, such as when there was an error, orat end of file, or when you refer to an uninitialized variable orelement of an array or hash.  Although in early versions of Perl,an undefined scalar could become defined when first used in aplace expecting a defined value, this no longer happens except forrare cases of autovivification as explained in perlref.  You canuse the \fIdefined()\fR operator to determine whether a scalar value isdefined (this has no meaning on arrays or hashes), and the \fIundef()\fRoperator to produce an undefined value..IX Xref "defined undefined undef null string, null".PPTo find out whether a given string is a valid non-zero number, it'ssometimes enough to test it against both numeric 0 and also lexical\&\*(L"0\*(R" (although this will cause noises if warnings are on).  That's because strings that aren't numbers count as 0, just as they do in \fBawk\fR:.PP.Vb 3\&    if ($str == 0 && $str ne "0")  {\&        warn "That doesn\*(Aqt look like a number";\&    }.Ve.PPThat method may be best because otherwise you won't treat \s-1IEEE\s0notations like \f(CW\*(C`NaN\*(C'\fR or \f(CW\*(C`Infinity\*(C'\fR properly.  At other times, youmight prefer to determine whether string data can be used numericallyby calling the \fIPOSIX::strtod()\fR function or by inspecting your stringwith a regular expression (as documented in perlre)..PP.Vb 8\&    warn "has nondigits"        if     /\eD/;\&    warn "not a natural number" unless /^\ed+$/;             # rejects \-3\&    warn "not an integer"       unless /^\-?\ed+$/;           # rejects +3\&    warn "not an integer"       unless /^[+\-]?\ed+$/;\&    warn "not a decimal number" unless /^\-?\ed+\e.?\ed*$/;     # rejects .2

⌨️ 快捷键说明

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