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

📄 perlcompile.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 "PERLCOMPILE 1".TH PERLCOMPILE 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"perlcompile \- Introduction to the Perl Compiler\-Translator.SH "DESCRIPTION".IX Header "DESCRIPTION"Perl has always had a compiler: your source is compiled into aninternal form (a parse tree) which is then optimized before beingrun.  Since version 5.005, Perl has shipped with a modulecapable of inspecting the optimized parse tree (\f(CW\*(C`B\*(C'\fR), and this hasbeen used to write many useful utilities, including a module that letsyou turn your Perl into C source code that can be compiled into anative executable..PPThe \f(CW\*(C`B\*(C'\fR module provides access to the parse tree, and other modules(\*(L"back ends\*(R") do things with the tree.  Some write it out assemi-human-readable text.  Another traverses the parse tree to build across-reference of which subroutines, formats, and variables are usedwhere.  Another checks your code for dubious constructs.  Yet another backend dumps the parse tree back out as Perl source, acting as a source codebeautifier or deobfuscator..PPBecause its original purpose was to be a way to produce C codecorresponding to a Perl program, and in turn a native executable, the\&\f(CW\*(C`B\*(C'\fR module and its associated back ends are known as \*(L"thecompiler\*(R", even though they don't really compile anything.Different parts of the compiler are more accurately a \*(L"translator\*(R",or an \*(L"inspector\*(R", but people want Perl to have a \*(L"compileroption\*(R" not an \*(L"inspector gadget\*(R".  What can you do?.PPThis document covers the use of the Perl compiler: which modulesit comprises, how to use the most important of the back end modules,what problems there are, and how to work around them..Sh "Layout".IX Subsection "Layout"The compiler back ends are in the \f(CW\*(C`B::\*(C'\fR hierarchy, and the front-end(the module that you, the user of the compiler, will sometimesinteract with) is the O module..PPHere are the important back ends to know about, with their statusexpressed as a number from 0 (outline for later implementation) to10 (if there's a bug in it, we're very surprised):.IP "B::Lint" 4.IX Item "B::Lint"Complains if it finds dubious constructs in your source code.  Status:6 (it works adequately, but only has a very limited number of areasthat it checks)..IP "B::Deparse" 4.IX Item "B::Deparse"Recreates the Perl source, making an attempt to format it coherently.Status: 8 (it works nicely, but a few obscure things are missing)..IP "B::Xref" 4.IX Item "B::Xref"Reports on the declaration and use of subroutines and variables.Status: 8 (it works nicely, but still has a few lingering bugs)..SH "Using The Back Ends".IX Header "Using The Back Ends"The following sections describe how to use the various compiler backends.  They're presented roughly in order of maturity, so that themost stable and proven back ends are described first, and the mostexperimental and incomplete back ends are described last..PPThe O module automatically enabled the \fB\-c\fR flag to Perl, whichprevents Perl from executing your code once it has been compiled.This is why all the back ends print:.PP.Vb 1\&  myperlprogram syntax OK.Ve.PPbefore producing any other output..Sh "The Cross Referencing Back End".IX Subsection "The Cross Referencing Back End"The cross referencing back end (B::Xref) produces a report on your program,breaking down declarations and uses of subroutines and variables (andformats) by file and subroutine.  For instance, here's part of thereport from the \fIpod2man\fR program that comes with Perl:.PP.Vb 12\&  Subroutine clear_noremap\&    Package (lexical)\&      $ready_to_print   i1069, 1079\&    Package main\&      $&                1086\&      $.                1086\&      $0                1086\&      $1                1087\&      $2                1085, 1085\&      $3                1085, 1085\&      $ARGV             1086\&      %HTML_Escapes     1085, 1085.Ve.PPThis shows the variables used in the subroutine \f(CW\*(C`clear_noremap\*(C'\fR.  Thevariable \f(CW$ready_to_print\fR is a \fImy()\fR (lexical) variable,\&\fBi\fRntroduced (first declared with \fImy()\fR) on line 1069, and used online 1079.  The variable \f(CW$&\fR from the main package is used on 1086,and so on..PPA line number may be prefixed by a single letter:.IP "i" 4.IX Item "i"Lexical variable introduced (declared with \fImy()\fR) for the first time..IP "&" 4Subroutine or method call..IP "s" 4.IX Item "s"Subroutine defined..IP "r" 4.IX Item "r"Format defined..PPThe most useful option the cross referencer has is to save the reportto a separate file.  For instance, to save the report on\&\fImyperlprogram\fR to the file \fIreport\fR:.PP.Vb 1\&  $ perl \-MO=Xref,\-oreport myperlprogram.Ve.Sh "The Decompiling Back End".IX Subsection "The Decompiling Back End"The Deparse back end turns your Perl source back into Perl source.  Itcan reformat along the way, making it useful as a de-obfuscator.  Themost basic way to use it is:.PP.Vb 1\&  $ perl \-MO=Deparse myperlprogram.Ve.PPYou'll notice immediately that Perl has no idea of how to paragraphyour code.  You'll have to separate chunks of code from each otherwith newlines by hand.  However, watch what it will do withone-liners:.PP.Vb 12\&  $ perl \-MO=Deparse \-e \*(Aq$op=shift||die "usage: $0\&  code [...]";chomp(@ARGV=<>)unless@ARGV; for(@ARGV){$was=$_;eval$op;\&  die$@ if$@; rename$was,$_ unless$was eq $_}\*(Aq\&  \-e syntax OK\&  $op = shift @ARGV || die("usage: $0 code [...]");\&  chomp(@ARGV = <ARGV>) unless @ARGV;\&  foreach $_ (@ARGV) {\&      $was = $_;\&      eval $op;\&      die $@ if $@;\&      rename $was, $_ unless $was eq $_;\&  }.Ve.PPThe decompiler has several options for the code it generates.  Forinstance, you can set the size of each indent from 4 (as above) to2 with:.PP.Vb 1\&  $ perl \-MO=Deparse,\-si2 myperlprogram.Ve.PPThe \fB\-p\fR option adds parentheses where normally they are omitted:.PP.Vb 6\&  $ perl \-MO=Deparse \-e \*(Aqprint "Hello, world\en"\*(Aq\&  \-e syntax OK\&  print "Hello, world\en";\&  $ perl \-MO=Deparse,\-p \-e \*(Aqprint "Hello, world\en"\*(Aq\&  \-e syntax OK\&  print("Hello, world\en");.Ve.PPSee B::Deparse for more information on the formatting options..Sh "The Lint Back End".IX Subsection "The Lint Back End"The lint back end (B::Lint) inspects programs for poor style.  Oneprogrammer's bad style is another programmer's useful tool, so optionslet you select what is complained about..PPTo run the style checker across your source code:.PP.Vb 1\&  $ perl \-MO=Lint myperlprogram.Ve.PPTo disable context checks and undefined subroutines:.PP.Vb 1\&  $ perl \-MO=Lint,\-context,\-undefined\-subs myperlprogram.Ve.PPSee B::Lint for information on the options..SH "Module List for the Compiler Suite".IX Header "Module List for the Compiler Suite".IP "B" 4.IX Item "B"This module is the introspective (\*(L"reflective\*(R" in Java terms)module, which allows a Perl program to inspect its innards.  Theback end modules all use this module to gain access to the compiledparse tree.  You, the user of a back end module, will not need tointeract with B..IP "O" 4.IX Item "O"This module is the front-end to the compiler's back ends.  Normallycalled something like this:.Sp.Vb 1\&  $ perl \-MO=Deparse myperlprogram.Ve.SpThis is like saying \f(CW\*(C`use O \*(AqDeparse\*(Aq\*(C'\fR in your Perl program..IP "B::Concise" 4.IX Item "B::Concise"This module prints a concise (but complete) version of the Perl parsetree.  Its output is more customizable than the one of B::Terse orB::Debug (and it can emulate them). This module useful for people whoare writing their own back end, or who are learning about the Perlinternals.  It's not useful to the average programmer..IP "B::Debug" 4.IX Item "B::Debug"This module dumps the Perl parse tree in verbose detail to \s-1STDOUT\s0.It's useful for people who are writing their own back end, or whoare learning about the Perl internals.  It's not useful to theaverage programmer..IP "B::Deparse" 4.IX Item "B::Deparse"This module produces Perl source code from the compiled parse tree.It is useful in debugging and deconstructing other people's code,also as a pretty-printer for your own source.  See\&\*(L"The Decompiling Back End\*(R" for details about usage..IP "B::Lint" 4.IX Item "B::Lint"This module inspects the compiled form of your source code for thingswhich, while some people frown on them, aren't necessarily bad enoughto justify a warning.  For instance, use of an array in scalar contextwithout explicitly saying \f(CW\*(C`scalar(@array)\*(C'\fR is something that Lintcan identify.  See \*(L"The Lint Back End\*(R" for details about usage..IP "B::Showlex" 4.IX Item "B::Showlex"This module prints out the \fImy()\fR variables used in a function or afile.  To get a list of the \fImy()\fR variables used in the subroutine\&\fImysub()\fR defined in the file myperlprogram:.Sp.Vb 1\&  $ perl \-MO=Showlex,mysub myperlprogram.Ve.SpTo get a list of the \fImy()\fR variables used in the file myperlprogram:.Sp.Vb 1\&  $ perl \-MO=Showlex myperlprogram.Ve.Sp[\s-1BROKEN\s0].IP "B::Terse" 4.IX Item "B::Terse"This module prints the contents of the parse tree, but without as muchinformation as B::Debug.  For comparison, \f(CW\*(C`print "Hello, world."\*(C'\fRproduced 96 lines of output from B::Debug, but only 6 from B::Terse..SpThis module is useful for people who are writing their own back end,or who are learning about the Perl internals.  It's not useful to theaverage programmer..IP "B::Xref" 4.IX Item "B::Xref"This module prints a report on where the variables, subroutines, andformats are defined and used within a program and the modules itloads.  See \*(L"The Cross Referencing Back End\*(R" for details aboutusage..SH "KNOWN PROBLEMS".IX Header "KNOWN PROBLEMS"BEGIN{} blocks are executed while compiling your code.  Any externalstate that is initialized in BEGIN{}, such as opening files, initiatingdatabase connections etc., do not behave properly.  To work aroundthis, Perl has an INIT{} block that corresponds to code being executedbefore your program begins running but after your program has finishedbeing compiled.  Execution order: BEGIN{}, (possible save of statethrough compiler back-end), INIT{}, program runs, END{}..SH "AUTHOR".IX Header "AUTHOR"This document was originally written by Nathan Torkington, and is nowmaintained by the perl5\-porters mailing list\&\fIperl5\-porters@perl.org\fR.

⌨️ 快捷键说明

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