Front page | perl.perl5.porters |
Postings from July 2011
[perl #95882] [PATCH] `git log --pretty=format:%s HEAD^1..HEAD`
Thread Previous
From:
Reini Urban
Date:
July 29, 2011 02:02
Subject:
[perl #95882] [PATCH] `git log --pretty=format:%s HEAD^1..HEAD`
Message ID:
rt-3.6.HEAD-7815-1311930124-178.95882-75-0@perl.org
# New Ticket Created by Reini Urban
# Please include the string: [perl #95882]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=95882 >
This is a bug report for perl from rurban@x-ray.at,
generated with the help of perlbug 1.39 running under perl 5.14.1.
>From cbaae958d898a99101d5cbddd516df162e419a1c Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@x-ray.at>
Date: Fri, 29 Jul 2011 10:57:50 +0200
Subject: [PATCH] remove the rest of pod/perlcompile.pod
perlcompile.pod is now maintained with B::C, and much more complete there.
Some missing bits were added to B::Terse and B::Xref.
All other documentation bits are already god enough.
---
ext/B/B/Terse.pm | 10 ++-
ext/B/B/Xref.pm | 50 +++++++++
pod/perlcompile.pod | 293 ---------------------------------------------------
3 files changed, 59 insertions(+), 294 deletions(-)
delete mode 100644 pod/perlcompile.pod
diff --git a/ext/B/B/Terse.pm b/ext/B/B/Terse.pm
index 562c58a..7badb53 100644
--- a/ext/B/B/Terse.pm
+++ b/ext/B/B/Terse.pm
@@ -78,7 +78,15 @@ B::Terse - Walk Perl syntax tree, printing terse info about ops
=head1 DESCRIPTION
-This version of B::Terse is really just a wrapper that calls B::Concise
+This module prints the contents of the parse tree, but without as much
+information as L<B::Debug>. For comparison, C<print "Hello, world.">
+produced 96 lines of output from B::Debug, but only 6 from B::Terse.
+
+This 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 the
+average programmer.
+
+This version of B::Terse is really just a wrapper that calls L<B::Concise>
with the B<-terse> option. It is provided for compatibility with old scripts
(and habits) but using B::Concise directly is now recommended instead.
diff --git a/ext/B/B/Xref.pm b/ext/B/B/Xref.pm
index 64e677c..a0f401e 100644
--- a/ext/B/B/Xref.pm
+++ b/ext/B/B/Xref.pm
@@ -48,6 +48,56 @@ letter "i". Subroutine and method calls are indicated by the character
"&". Subroutine definitions are indicated by "s" and format
definitions by "f".
+For instance, here's part of the report from the I<pod2man> program that
+comes with Perl:
+
+ 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
+
+This shows the variables used in the subroutine C<clear_noremap>. The
+variable C<$ready_to_print> is a my() (lexical) variable,
+B<i>ntroduced (first declared with my()) on line 1069, and used on
+line 1079. The variable C<$&> from the main package is used on 1086,
+and so on.
+
+A line number may be prefixed by a single letter:
+
+=over 4
+
+=item i
+
+Lexical variable introduced (declared with my()) for the first time.
+
+=item &
+
+Subroutine or method call.
+
+=item s
+
+Subroutine defined.
+
+=item r
+
+Format defined.
+
+=back
+
+The most useful option the cross referencer has is to save the report
+to a separate file. For instance, to save the report on
+I<myperlprogram> to the file I<report>:
+
+ $ perl -MO=Xref,-oreport myperlprogram
+
=head1 OPTIONS
Option words are separated by commas (not whitespace) and follow the
diff --git a/pod/perlcompile.pod b/pod/perlcompile.pod
deleted file mode 100644
index dc829f4..0000000
--- a/pod/perlcompile.pod
+++ /dev/null
@@ -1,293 +0,0 @@
-=head1 NAME
-
-perlcompile - Introduction to the Perl Compiler-Translator
-
-=head1 DESCRIPTION
-
-Perl has always had a compiler: your source is compiled into an
-internal form (a parse tree) which is then optimized before being
-run. Since version 5.005, Perl has shipped with a module
-capable of inspecting the optimized parse tree (C<B>), and this has
-been used to write many useful utilities, including a module that lets
-you turn your Perl into C source code that can be compiled into a
-native executable.
-
-The C<B> module provides access to the parse tree, and other modules
-("back ends") do things with the tree. Some write it out as
-semi-human-readable text. Another traverses the parse tree to build a
-cross-reference of which subroutines, formats, and variables are used
-where. Another checks your code for dubious constructs. Yet another back
-end dumps the parse tree back out as Perl source, acting as a source code
-beautifier or deobfuscator.
-
-Because its original purpose was to be a way to produce C code
-corresponding to a Perl program, and in turn a native executable, the
-C<B> module and its associated back ends are known as "the
-compiler", even though they don't really compile anything.
-Different parts of the compiler are more accurately a "translator",
-or an "inspector", but people want Perl to have a "compiler
-option" not an "inspector gadget". What can you do?
-
-This document covers the use of the Perl compiler: which modules
-it comprises, how to use the most important of the back end modules,
-what problems there are, and how to work around them.
-
-=head2 Layout
-
-The compiler back ends are in the C<B::> hierarchy, and the front-end
-(the module that you, the user of the compiler, will sometimes
-interact with) is the O module.
-
-Here are the important back ends to know about, with their status
-expressed as a number from 0 (outline for later implementation) to
-10 (if there's a bug in it, we're very surprised):
-
-=over 4
-
-=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 areas
-that it checks).
-
-=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).
-
-=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).
-
-=back
-
-=head1 Using The Back Ends
-
-The following sections describe how to use the various compiler back
-ends. They're presented roughly in order of maturity, so that the
-most stable and proven back ends are described first, and the most
-experimental and incomplete back ends are described last.
-
-The O module automatically enabled the B<-c> flag to Perl, which
-prevents Perl from executing your code once it has been compiled.
-This is why all the back ends print:
-
- myperlprogram syntax OK
-
-before producing any other output.
-
-=head2 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 (and
-formats) by file and subroutine. For instance, here's part of the
-report from the I<pod2man> program that comes with Perl:
-
- 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
-
-This shows the variables used in the subroutine C<clear_noremap>. The
-variable C<$ready_to_print> is a my() (lexical) variable,
-B<i>ntroduced (first declared with my()) on line 1069, and used on
-line 1079. The variable C<$&> from the main package is used on 1086,
-and so on.
-
-A line number may be prefixed by a single letter:
-
-=over 4
-
-=item i
-
-Lexical variable introduced (declared with my()) for the first time.
-
-=item &
-
-Subroutine or method call.
-
-=item s
-
-Subroutine defined.
-
-=item r
-
-Format defined.
-
-=back
-
-The most useful option the cross referencer has is to save the report
-to a separate file. For instance, to save the report on
-I<myperlprogram> to the file I<report>:
-
- $ perl -MO=Xref,-oreport myperlprogram
-
-=head2 The Decompiling Back End
-
-The Deparse back end turns your Perl source back into Perl source. It
-can reformat along the way, making it useful as a deobfuscator. The
-most basic way to use it is:
-
- $ perl -MO=Deparse myperlprogram
-
-You'll notice immediately that Perl has no idea of how to paragraph
-your code. You'll have to separate chunks of code from each other
-with newlines by hand. However, watch what it will do with
-one-liners:
-
- $ perl -MO=Deparse -e '$op=shift||die "usage: $0
- code [...]";chomp(@ARGV=<>)unless@ARGV; for(@ARGV){$was=$_;eval$op;
- die$@ if$@; rename$was,$_ unless$was eq $_}'
- -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 $_;
- }
-
-The decompiler has several options for the code it generates. For
-instance, you can set the size of each indent from 4 (as above) to
-2 with:
-
- $ perl -MO=Deparse,-si2 myperlprogram
-
-The B<-p> option adds parentheses where normally they are omitted:
-
- $ perl -MO=Deparse -e 'print "Hello, world\n"'
- -e syntax OK
- print "Hello, world\n";
- $ perl -MO=Deparse,-p -e 'print "Hello, world\n"'
- -e syntax OK
- print("Hello, world\n");
-
-See L<B::Deparse> for more information on the formatting options.
-
-=head2 The Lint Back End
-
-The lint back end (B::Lint) inspects programs for poor style. One
-programmer's bad style is another programmer's useful tool, so options
-let you select what is complained about.
-
-To run the style checker across your source code:
-
- $ perl -MO=Lint myperlprogram
-
-To disable context checks and undefined subroutines:
-
- $ perl -MO=Lint,-context,-undefined-subs myperlprogram
-
-See L<B::Lint> for information on the options.
-
-=head1 Module List for the Compiler Suite
-
-=over 4
-
-=item B
-
-This module is the introspective ("reflective" in Java terms)
-module, which allows a Perl program to inspect its innards. The
-back end modules all use this module to gain access to the compiled
-parse tree. You, the user of a back end module, will not need to
-interact with B.
-
-=item O
-
-This module is the front-end to the compiler's back ends. Normally
-called something like this:
-
- $ perl -MO=Deparse myperlprogram
-
-This is like saying C<use O 'Deparse'> in your Perl program.
-
-=item B::Concise
-
-This module prints a concise (but complete) version of the Perl parse
-tree. Its output is more customizable than the one of B::Terse or
-B::Debug (and it can emulate them). This 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 the average programmer.
-
-=item B::Debug
-
-This module dumps the Perl parse tree in verbose detail to STDOUT.
-It's useful for people who are writing their own back end, or who
-are learning about the Perl internals. It's not useful to the
-average programmer.
-
-=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"> for details about usage.
-
-=item B::Lint
-
-This module inspects the compiled form of your source code for things
-which, while some people frown on them, aren't necessarily bad enough
-to justify a warning. For instance, use of an array in scalar context
-without explicitly saying C<scalar(@array)> is something that Lint
-can identify. See L</"The Lint Back End"> for details about usage.
-
-=item B::Showlex
-
-This module prints out the my() variables used in a function or a
-file. To get a list of the my() variables used in the subroutine
-mysub() defined in the file myperlprogram:
-
- $ perl -MO=Showlex,mysub myperlprogram
-
-To get a list of the my() variables used in the file myperlprogram:
-
- $ perl -MO=Showlex myperlprogram
-
-[BROKEN]
-
-=item B::Terse
-
-This module prints the contents of the parse tree, but without as much
-information as B::Debug. For comparison, C<print "Hello, world.">
-produced 96 lines of output from B::Debug, but only 6 from B::Terse.
-
-This 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 the
-average programmer.
-
-=item B::Xref
-
-This module prints a report on where the variables, subroutines, and
-formats are defined and used within a program and the modules it
-loads. See L</"The Cross-Referencing Back End"> for details about
-usage.
-
-=back
-
-=head1 KNOWN PROBLEMS
-
-BEGIN{} blocks are executed while compiling your code. Any external
-state that is initialized in BEGIN{}, such as opening files, initiating
-database connections etc., do not behave properly. To work around
-this, Perl has an INIT{} block that corresponds to code being executed
-before your program begins running but after your program has finished
-being compiled. Execution order: BEGIN{}, (possible save of state
-through compiler back-end), INIT{}, program runs, END{}.
-
-=head1 AUTHOR
-
-This document was originally written by Nathan Torkington, and is now
-maintained by the perl5-porters mailing list
-I<perl5-porters@perl.org>.
-
-=cut
--
1.7.5.1
---
Flags:
category=docs
severity=medium
---
Site configuration information for perl 5.14.1:
Configured by rurban at Thu Jul 14 12:50:51 CEST 2011.
Summary of my perl5 (revision 5 version 14 subversion 1) configuration:
Platform:
osname=cygwin, osvers=1.7.10s(0.24853), archname=cygwin-thread-multi-64int
uname='cygwin_nt-6.1 atgrzwn503050 1.7.10s(0.24853) 20110711 00:04:53 i686 cygwin '
config_args='-de -Dlibperl=cygperl5_14.dll -Dcc=gcc-4 -Dld=g++-4 -Dmksymlinks -Dusethreads -Dmad=y -Dstatic_ext=Cwd -Doptimize=-O3 -Accflags=-g3'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='gcc-4', ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
optimize='-O3',
cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.3.4 20090804 (release) 1', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++-4', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
perllibs=-ldl -lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=cygperl5_14.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector'
Locally applied patches:
Bug#55162 File::Spec::case_tolerant performance
CYG15 static Win32CORE
CYG17 cyg-1.7 paths-utf8
0c612ce82 Fix building static extensions on cygwin, -UUSEIMPORTLIB
---
@INC for perl 5.14.1:
/usr/lib/perl5/site_perl/5.14/i686-cygwin
/usr/lib/perl5/site_perl/5.14
/usr/lib/perl5/vendor_perl/5.14/i686-cygwin
/usr/lib/perl5/vendor_perl/5.14
/usr/lib/perl5/5.14/i686-cygwin
/usr/lib/perl5/5.14
/usr/lib/perl5/site_perl/5.10
/usr/lib/perl5/vendor_perl/5.10
/usr/lib/perl5/site_perl/5.8
.
---
Environment for perl 5.14.1:
HOME=/home/urbanr
LANG=C.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=.:/home/urbanr/bin:~/bin:/usr/local/bin:/usr/bin:/usr/sbin:/cygdrive/c/strawberry/c/bin:/cygdrive/c/WINDOWS/System32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/WBEM:/cygdrive/c/PROGRA~1/ATT/Graphviz/bin:/cygdrive/c/PROGRA~1/ATT/Graphviz/bin/tools:/usr/lib/lapack:/cygdrive/c/oracle/ora112/bin
PERL_BADLANG (unset)
SHELL (unset)
Thread Previous