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

📄 a2p.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
字号:
.\" 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 "A2P 1".TH A2P 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"a2p \- Awk to Perl translator.SH "SYNOPSIS".IX Header "SYNOPSIS"\&\fBa2p\fR [\fIoptions\fR] [\fIfilename\fR].SH "DESCRIPTION".IX Header "DESCRIPTION"\&\fIA2p\fR takes an awk script specified on the command line (or fromstandard input) and produces a comparable \fIperl\fR script on thestandard output..Sh "\s-1OPTIONS\s0".IX Subsection "OPTIONS"Options include:.IP "\fB\-D<number>\fR" 5.IX Item "-D<number>"sets debugging flags..IP "\fB\-F<character>\fR" 5.IX Item "-F<character>"tells a2p that this awk script is always invoked with this \fB\-F\fRswitch..IP "\fB\-n<fieldlist>\fR" 5.IX Item "-n<fieldlist>"specifies the names of the input fields if input does not have to besplit into an array.  If you were translating an awk script thatprocesses the password file, you might say:.Sp.Vb 1\&        a2p \-7 \-nlogin.password.uid.gid.gcos.shell.home.Ve.SpAny delimiter can be used to separate the field names..IP "\fB\-<number>\fR" 5.IX Item "-<number>"causes a2p to assume that input will always have that many fields..IP "\fB\-o\fR" 5.IX Item "-o"tells a2p to use old awk behavior.  The only current differences are:.RS 5.IP "\(bu" 5Old awk always has a line loop, even if there are no lineactions, whereas new awk does not..IP "\(bu" 5In old awk, sprintf is extremely greedy about its arguments.For example, given the statement.Sp.Vb 1\&        print sprintf(some_args), extra_args;.Ve.Spold awk considers \fIextra_args\fR to be arguments to \f(CW\*(C`sprintf\*(C'\fR; new awkconsiders them arguments to \f(CW\*(C`print\*(C'\fR..RE.RS 5.RE.ie n .Sh """Considerations""".el .Sh "``Considerations''".IX Subsection "Considerations"A2p cannot do as good a job translating as a human would, but itusually does pretty well.  There are some areas where you may want toexamine the perl script produced and tweak it some.  Here are some ofthem, in no particular order..PPThere is an awk idiom of putting \fIint()\fR around a string expression toforce numeric interpretation, even though the argument is alwaysinteger anyway.  This is generally unneeded in perl, but a2p can'ttell if the argument is always going to be integer, so it leaves itin.  You may wish to remove it..PPPerl differentiates numeric comparison from string comparison.  Awkhas one operator for both that decides at run time which comparison todo.  A2p does not try to do a complete job of awk emulation at thispoint.  Instead it guesses which one you want.  It's almost alwaysright, but it can be spoofed.  All such guesses are marked with thecomment "\f(CW\*(C`#???\*(C'\fR".  You should go through and check them.  You mightwant to run at least once with the \fB\-w\fR switch to perl, which willwarn you if you use == where you should have used eq..PPPerl does not attempt to emulate the behavior of awk in whichnonexistent array elements spring into existence simply by beingreferenced.  If somehow you are relying on this mechanism to createnull entries for a subsequent for...in, they won't be there in perl..PPIf a2p makes a split line that assigns to a list of variables thatlooks like (Fld1, Fld2, Fld3...) you may want to rerun a2p using the\&\fB\-n\fR option mentioned above.  This will let you name the fieldsthroughout the script.  If it splits to an array instead, the scriptis probably referring to the number of fields somewhere..PPThe exit statement in awk doesn't necessarily exit; it goes to the \s-1END\s0block if there is one.  Awk scripts that do contortions within the \s-1END\s0block to bypass the block under such circumstances can be simplifiedby removing the conditional in the \s-1END\s0 block and just exiting directlyfrom the perl script..PPPerl has two kinds of array, numerically-indexed and associative.Perl associative arrays are called \*(L"hashes\*(R".  Awk arrays are usuallytranslated to hashes, but if you happen to know that the index isalways going to be numeric you could change the {...} to [...].Iteration over a hash is done using the \fIkeys()\fR function, but iterationover an array is \s-1NOT\s0.  You might need to modify any loop that iteratesover such an array..PPAwk starts by assuming \s-1OFMT\s0 has the value %.6g.  Perl starts byassuming its equivalent, $#, to have the value %.20g.  You'll want toset $# explicitly if you use the default value of \s-1OFMT\s0..PPNear the top of the line loop will be the split operation that isimplicit in the awk script.  There are times when you can move thisdown past some conditionals that test the entire record so that thesplit is not done as often..PPFor aesthetic reasons you may wish to change the array base $[ from 1back to perl's default of 0, but remember to change all arraysubscripts \s-1AND\s0 all \fIsubstr()\fR and \fIindex()\fR operations to match..PPCute comments that say \*(L"# Here is a workaround because awk is dumb\*(R"are passed through unmodified..PPAwk scripts are often embedded in a shell script that pipes stuff intoand out of awk.  Often the shell script wrapper can be incorporatedinto the perl script, since perl can start up pipes into and out ofitself, and can do other things that awk can't do by itself..PPScripts that refer to the special variables \s-1RSTART\s0 and \s-1RLENGTH\s0 canoften be simplified by referring to the variables $`, $& and $', aslong as they are within the scope of the pattern match that sets them..PPThe produced perl script may have subroutines defined to deal withawk's semantics regarding getline and print.  Since a2p usually pickscorrectness over efficiency.  it is almost always possible to rewritesuch code to be more efficient by discarding the semantic sugar..PPFor efficiency, you may wish to remove the keyword from any returnstatement that is the last statement executed in a subroutine.  A2pcatches the most common case, but doesn't analyze embedded blocks forsubtler cases..PPARGV[0] translates to \f(CW$ARGV0\fR, but ARGV[n] translates to \f(CW$ARGV\fR[$n].  Aloop that tries to iterate over ARGV[0] won't find it..SH "ENVIRONMENT".IX Header "ENVIRONMENT"A2p uses no environment variables..SH "AUTHOR".IX Header "AUTHOR"Larry Wall <\fIlarry@wall.org\fR>.SH "FILES".IX Header "FILES".SH "SEE ALSO".IX Header "SEE ALSO".Vb 1\& perl   The perl compiler/interpreter\& \& s2p    sed to perl translator.Ve.SH "DIAGNOSTICS".IX Header "DIAGNOSTICS".SH "BUGS".IX Header "BUGS"It would be possible to emulate awk's behavior in selecting stringversus numeric operations at run time by inspection of the operands,but it would be gross and inefficient.  Besides, a2p almost alwaysguesses right..PPStorage for the awk syntax tree is currently static, and can run out.

⌨️ 快捷键说明

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