POD2-RU
view release on metacpan or search on metacpan
lib/POD2/RU/perlguts.pod view on Meta::CPAN
abstraction layer and not make any assumptions about what kind of stdio
is being used.
For a complete description of the PerlIO abstraction, consult L<perlapio>.
=head2 Putting a C value on Perl stack
A lot of opcodes (this is an elementary operation in the internal perl
stack machine) put an SV* on the stack. However, as an optimization
the corresponding SV is (usually) not recreated each time. The opcodes
reuse specially assigned SVs (I<target>s) which are (as a corollary)
not constantly freed/created.
Each of the targets is created only once (but see
L<Scratchpads and recursion> below), and when an opcode needs to put
an integer, a double, or a string on stack, it just sets the
corresponding parts of its I<target> and puts the I<target> on stack.
The macro to put this target on stack is C<PUSHTARG>, and it is
directly used in some opcodes, as well as indirectly in zillions of
others, which use it via C<(X)PUSH[iunp]>.
lib/POD2/RU/perlguts.pod view on Meta::CPAN
(but slightly more complicated). This tree reflects the way Perl
parsed your code, but has nothing to do with the execution order.
There is an additional "thread" going through the nodes of the tree
which shows the order of execution of the nodes. In our simplified
example above it looks like:
$b ---> $c ---> + ---> $a ---> assign-to
But with the actual compile tree for C<$a = $b + $c> it is different:
some nodes I<optimized away>. As a corollary, though the actual tree
contains more nodes than our simplified example, the execution order
is the same as in our example.
=head2 Examining the tree
If you have your perl compiled for debugging (usually done with
C<-DDEBUGGING> on the C<Configure> command line), you may examine the
compiled tree by specifying C<-Dx> on the Perl command line. The
output takes several lines per node, and for C<$b+$c> it looks like
this:
lib/POD2/RU/perlpodspec.pod view on Meta::CPAN
=end outer
Z
=end inner
This latter is improper because when the "=end outer" command is seen, the
currently open region has the formatname "inner", not "outer". (It just
happens that "outer" is the format name of a higher-up region.) This is
an error. Processors must by default report this as an error, and may halt
processing the document containing that error. A corollary of this is that
regions cannot "overlap". That is, the latter block above does not represent
a region called "outer" which contains X and Y, overlapping a region called
"inner" which contains Y and Z. But because it is invalid (as all
apparently overlapping regions would be), it doesn't represent that, or
anything at all.
Similarly, this is invalid:
=begin thing
( run in 0.406 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )