| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds syntax `defer { BLOCK }` to create a deferred block; code that is
deferred until the scope exits. This syntax is guarded by
use feature 'defer';
Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field
gives the start of an optree to be deferred until scope exit. That op
pointer will be stored on the save stack and invoked as part of scope
unwind.
Included is support for `B::Deparse` to deparse the optree back into
syntax.
|
|
|
|
| |
TonyC: placate podcheck by wrapping a verbatim line.
|
|
|
|
|
|
|
|
| |
Break one long paragraph into four. Break some long sentences in two.
Correct one spelling error. Use POD formatting more consistently on
'package'.
More for RT #129345
|
| |
|
|
|
|
| |
For: RT #129345
|
|
|
|
|
|
| |
• Outward links for perlmod
• Tweak perlmodstyle version notes
• Link perlnewmod to perlmodstyle
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the way that code blocks in patterns are parsed and executed,
especially as regards lexical and scoping behaviour.
(Note that this fix only applies to literal code blocks appearing within
patterns: run-time patterns, and literals within qr//, are still done the
old broken way for now).
This change means that for literal /(?{..})/ and /(??{..})/:
* the code block is now fully parsed in the same pass as the surrounding
code, which means that the compiler no longer just does a simplistic
count of balancing {} to find the limits of the code block;
i.e. stuff like /(?{ $x = "{" })/ now works (in the same way
that subscripts in double quoted strings always have: "$a{'{'}" )
* Error and warning messages will now appear to emanate from the main body
rather than an re_eval; e.g. the output from
#!/usr/bin/perl
/(?{ warn "boo" })/
has changed from
boo at (re_eval 1) line 1.
to
boo at /tmp/p line 2.
* scope and closures now behave as you might expect; for example
for my $x (qw(a b c)) { "" =~ /(?{ print $x })/ }
now prints "abc" rather than ""
* with recursion, it now finds the lexical within the appropriate depth
of pad: this code now prints "012" rather than "000":
sub recurse {
my ($n) = @_;
return if $n > 2;
"" =~ /^(?{print $n})/;
recurse($n+1);
}
recurse(0);
* an earlier fix that stopped 'my' declarations within code blocks causing
crashes, required the accumulating of two SAVECOMPPADs on the stack for
each iteration of the code block; this is no longer needed;
* UNITCHECK blocks within literal code blocks are now run as part of the
main body of code (run-time code blocks still trigger an immediate
call to the UNITCHECK block though)
This is all achieved by building upon the efforts of the commits which led
up to this; those altered the parser to parse literal code blocks
directly, but up until now those code blocks were discarded by
Perl_pmruntime and the block re-compiled using the original re_eval
mechanism. As of this commit, for the non-qr and non-runtime variants,
those code blocks are no longer thrown away. Instead:
* the LISTOP generated by the parser, which contains all the code
blocks plus OP_CONSTs that collectively make up the literal pattern,
is now stored in a new field in PMOPs, called op_code_list. For example
in /A(?{BLOCK})C/, the listop stored in op_code_list looks like
LIST
PUSHMARK
CONST['A']
NULL/special (aka a DO block)
BLOCK
CONST['(?{BLOCK})']
CONST['B']
* each of the code blocks has its last op set to null and is individually
run through the peephole optimiser, so each one becomes a little
self-contained block of code, rather than a list of blocks that run into
each other;
* then in re_op_compile(), we concatenate the list of CONSTs to produce a
string to be compiled, but at the same time we note any DO blocks and
note the start and end positions of the corresponding CONST['(?{BLOCK})'];
* (if the current regex engine isn't the built-in perl one, then we just
throw away the code blocks and pass the concatenated string to the engine)
* then during regex compilation, whenever we encounter a '(?{', we see if
it matches the index of one of the pre-compiled blocks, and if so, we
store a pointer to that block in an 'l' data slot, and use the end index
to skip over the text of the code body. Conversely, if the index doesn't
match, then we know that it's a run-time pattern and (for now), compile
it in the old way.
* During execution, when an EVAL op is encountered, if data->what is 'l',
then we just use the pad that was in effect when the pattern was called;
i.e. we use the current pad slot of the currently executing CV that the
pattern is embedded within.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it more like a real module would be written while retaining it's utility as a teaching boilerplate.
* require Exporter instead of use with no import
* Declare and initialize variables together.
* Eliminate archaic RCS/CVS versioning clutter.
* Explain what @ISA does.
* Remove archaic (and slower) &func syntax from exporting
* Remove %EXPORT_TAGS. It's not explained and rarely used.
* Remove redundant @EXPORT_OK
* Use cleaner $priv_func->() syntax rather than &$priv_func.
* Eliminate prototypes, they're clutter, rarely used and dangerous.
TonyC: update known_pod_issues.dat
|
| |
|
|
|
|
|
|
| |
where appropriate
Used buildtoc to regenerate pod-related files
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81906]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81906 >
|
| |
|
|
|
|
|
| |
Signed-off-by: Florian Ragwitz <rafl@debian.org>
[rafl@debian.org: Minor rewording based on input from TIMB]
|
|
|
|
|
| |
Signed-off-by: Florian Ragwitz <rafl@debian.org>
[rafl@debian.org: Minor wording tweaks]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I looked at all the instances of spaces around -- and in most cases
converted the sentences to use more appropriate punctuation. In
general, the -- in the perl docs seem to be there only to make
really complicated and really long sentences.
I didn't look at the closed em-dashes. They probably have the same
sentence-complexity problem.
I left some open em-dashes in place. Those are the ones used in
lists.
|
|
|
|
| |
(based on suggestions by David Nicol and chromatic)
|
|
|
|
|
|
| |
From: "Bram via RT" <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-29759-1218011060-645.57646-15-0@perl.org>
p4raw-id: //depot/perl@34221
|
|
|
|
|
|
| |
clarify the documentation on CLONE_SKIP, and ensure that the
undef value has all its flags cleared
p4raw-id: //depot/perl@32213
|
|
|
| |
p4raw-id: //depot/perl@30685
|
|
|
|
|
| |
Message-ID: <20061019120412.GA12290@the.earth.li>
p4raw-id: //depot/perl@29053
|
|
|
|
|
| |
describing what exec() does
p4raw-id: //depot/perl@26145
|
|
|
|
|
| |
Message-ID: <434D9A32.4050305@cpan.org>
p4raw-id: //depot/perl@25748
|
|
|
|
|
| |
Message-ID: <56942505060123146e5eb1c2@mail.gmail.com>
p4raw-id: //depot/perl@24822
|
|
|
|
|
| |
cloning objects during thread creation
p4raw-id: //depot/perl@24247
|
|
|
|
|
| |
More eloquent rewording desired. Patches welcome.
p4raw-id: //depot/perl@23062
|
|
|
|
|
|
| |
Subject: [DOCPATCH] BEGIN, CHECK, INIT, END explained more
Message-Id: <p05111b01bbeec2e8bf30@[192.168.56.3]>
p4raw-id: //depot/perl@21832
|
|
|
|
|
| |
Message-Id: <Pine.BSO.4.53.0311111547500.9242@blue.stonehenge.com>
p4raw-id: //depot/perl@21706
|
|
|
|
|
| |
INIT blocks. See bug [perl #22826].
p4raw-id: //depot/perl@19872
|
|
|
|
|
| |
Message-ID: <20030503223016.GE1234@windhund.schwern.org>
p4raw-id: //depot/perl@19425
|
|
|
|
|
|
|
| |
From: Chris Pepper (via RT) <perlbug-followup@perl.org>
Message-Id: <rt-22011-55473.11.0523590303906@bugs6.perl.org>
(with minor further corrections)
p4raw-id: //depot/perl@19319
|
|
|
|
|
| |
Message-ID: <20020828194934.GA12244@not.autrijus.org>
p4raw-id: //depot/perl@17814
|
|
|
| |
p4raw-id: //depot/perl@17135
|
|
|
| |
p4raw-id: //depot/perl@17134
|
|
|
| |
p4raw-id: //depot/perl@12132
|
|
|
|
|
|
| |
Message-Id: <3BABC50D.6040202@home.com>
(Applied with some changes.)
p4raw-id: //depot/perl@12125
|
|
|
|
|
| |
Message-ID: <B7542BEC.1719%artur@contiller.se>
p4raw-id: //depot/perl@10694
|
|
|
|
|
| |
Message-ID: <20010315200112.A7636@firedrake.org>
p4raw-id: //depot/perl@9175
|
|
|
|
|
| |
Message-ID: <39E8A604.B501DB4F@bellsouth.net>
p4raw-id: //depot/perl@7241
|
|
|
|
|
| |
Message-Id: <20000915020409.A2104@ilmd>
p4raw-id: //depot/perl@7097
|
|
|
| |
p4raw-id: //depot/perl@6007
|
|
|
| |
p4raw-id: //depot/perl@5957
|
|
|
| |
p4raw-id: //depot/perl@5917
|
|
|
| |
p4raw-id: //depot/perl@5712
|
|
|
| |
p4raw-id: //depot/perl@4905
|