summaryrefslogtreecommitdiff
path: root/pod/perlmod.pod
Commit message (Collapse)AuthorAgeFilesLines
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-0/+4
| | | | | | | | | | | | | | | 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.
* modernize Exporter usage in perlmod module templateDan Book2019-04-151-13/+10
| | | | TonyC: placate podcheck by wrapping a verbatim line.
* Readability improvements.James E Keenan2016-12-111-8/+12
| | | | | | | | 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
* tweak perlmod.podYves Orton2016-12-061-3/+9
|
* Improve discussion of packages and their scopes.James E Keenan2016-12-061-16/+28
| | | | For: RT #129345
* perlmod and perlstyle improvementsEd J2014-09-241-0/+21
| | | | | | • Outward links for perlmod • Tweak perlmodstyle version notes • Link perlnewmod to perlmodstyle
* Fixed verbatim lines in POD over 79 charactersBrian Gottreu2013-06-221-2/+3
|
* perlmod: #109408Brian Fraser2012-06-271-4/+3
|
* Mostly complete fix for literal /(?{..})/ blocksDavid Mitchell2012-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unnecessary cruft from the module example.Michael G. Schwern2011-10-291-38/+23
| | | | | | | | | | | | | | | | 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
* Fixed dative inaccuracy in perlmod.pod.chromatic2011-10-281-3/+3
|
* Remove all references to old OO tutorial docs, and add refs to perlootut ↵Dave Rolsky2011-09-081-2/+2
| | | | | | where appropriate Used buildtoc to regenerate pod-related files
* Fix typos in several pod/perl*.pod filesKeith Thompson2011-07-311-2/+2
|
* Fix typo in perlmodFather Chrysostomos2011-06-121-1/+1
|
* [perl #78074] Make it explicit that symtab manipulation is not supportedFather Chrysostomos2011-05-181-0/+4
|
* Fix bad pod links found by Test::Pod::LinkCheckApocalypse2011-02-151-1/+1
|
* Fix typos in pod/*Peter J. Acklam) (via RT2011-01-071-2/+2
| | | | | | | # 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 >
* Fix a typo in perlmodFlorian Ragwitz2010-11-291-1/+1
|
* add example for ${^GLOBAL_PHASE} and description to perlmodChas. J. Owens IV2010-11-141-0/+11
| | | | | Signed-off-by: Florian Ragwitz <rafl@debian.org> [rafl@debian.org: Minor rewording based on input from TIMB]
* string do and require don't execute INIT and CHECK blocksChas. J. Owens IV2010-11-141-4/+4
| | | | | Signed-off-by: Florian Ragwitz <rafl@debian.org> [rafl@debian.org: Minor wording tweaks]
* * Em dash cleanup in pod/brian d foy2010-01-131-2/+2
| | | | | | | | | | | | | 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.
* Rephrase note about CHECK and INIT in eval("") in perlmodRafael Garcia-Suarez2009-07-241-5/+5
| | | | (based on suggestions by David Nicol and chromatic)
* [perl #57646] Weird non-equivalence between $::{'a'} = sub {} and *::a = sub {} Bram2008-08-241-10/+1
| | | | | | 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
* [perl #47045] CLONE_SKIP doesn't result in undef copiesDave Mitchell2007-11-021-0/+3
| | | | | | clarify the documentation on CLONE_SKIP, and ensure that the undef value has all its flags cleared p4raw-id: //depot/perl@32213
* Remove references to perlcc from the core docs.Rafael Garcia-Suarez2007-03-221-3/+1
| | | p4raw-id: //depot/perl@30685
* stab at UNITCHECK blocksAlexander Gough2006-10-191-22/+36
| | | | | Message-ID: <20061019120412.GA12290@the.earth.li> p4raw-id: //depot/perl@29053
* It's clearer to use "morphing" than "polymorphing" whenRafael Garcia-Suarez2005-11-171-1/+1
| | | | | describing what exec() does p4raw-id: //depot/perl@26145
* POD index entries with X<>Ivan Tubert-Brohman2005-10-131-0/+12
| | | | | Message-ID: <434D9A32.4050305@cpan.org> p4raw-id: //depot/perl@25748
* Re: [perl #36047] perlmod.pod/CLONESKIP errorOffer Kaye2005-06-131-1/+2
| | | | | Message-ID: <56942505060123146e5eb1c2@mail.gmail.com> p4raw-id: //depot/perl@24822
* Add CLONE_SKIP() class method to allow individual classes to skipDave Mitchell2005-04-191-1/+17
| | | | | cloning objects during thread creation p4raw-id: //depot/perl@24247
* First stab at explaining that CLONE may get more parameters in future.Nicholas Clark2004-07-071-4/+7
| | | | | More eloquent rewording desired. Patches welcome. p4raw-id: //depot/perl@23062
* Better docs for the special code blocks, based on :Elizabeth Mattijsen2003-12-021-22/+38
| | | | | | Subject: [DOCPATCH] BEGIN, CHECK, INIT, END explained more Message-Id: <p05111b01bbeec2e8bf30@[192.168.56.3]> p4raw-id: //depot/perl@21832
* Re: [perl #24460] [DOC PATCH] the begincheck programTom Phoenix2003-11-111-1/+31
| | | | | Message-Id: <Pine.BSO.4.53.0311111547500.9242@blue.stonehenge.com> p4raw-id: //depot/perl@21706
* Some clarification about the current semantics of CHECK andRafael Garcia-Suarez2003-06-281-9/+11
| | | | | INIT blocks. See bug [perl #22826]. p4raw-id: //depot/perl@19872
* Simpler $Revision$ based $VERSION. Plus, repentance!Michael G. Schwern2003-05-051-1/+1
| | | | | Message-ID: <20030503223016.GE1234@windhund.schwern.org> p4raw-id: //depot/perl@19425
* [perl #22011] [PATCH] pod/perlmod.pod (v5.8.0)Chris Pepper2003-04-231-15/+16
| | | | | | | 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
* perlmod.pod nitAudrey Tang2002-08-301-1/+2
| | | | | Message-ID: <20020828194934.GA12244@not.autrijus.org> p4raw-id: //depot/perl@17814
* Follow up on changing keyword to special subroutine.Artur Bergman2002-06-091-2/+2
| | | p4raw-id: //depot/perl@17135
* CLONE doc tweaks.Jarkko Hietaniemi2002-06-091-6/+8
| | | p4raw-id: //depot/perl@17134
* Rename perltootc as perltooc for 8.3-friedliness.Jarkko Hietaniemi2001-09-221-1/+1
| | | p4raw-id: //depot/perl@12132
* Re: [ID 20010919.001] local() fails on imported variablesMichael Carman2001-09-221-1/+37
| | | | | | Message-Id: <3BABC50D.6040202@home.com> (Applied with some changes.) p4raw-id: //depot/perl@12125
* Documentation changes for CLONEArtur Bergman2001-06-181-0/+17
| | | | | Message-ID: <B7542BEC.1719%artur@contiller.se> p4raw-id: //depot/perl@10694
* the uncontroversial doc patchesMichael Stevens2001-03-161-2/+2
| | | | | Message-ID: <20010315200112.A7636@firedrake.org> p4raw-id: //depot/perl@9175
* small pod patchDan Boorstein2000-10-161-0/+4
| | | | | Message-ID: <39E8A604.B501DB4F@bellsouth.net> p4raw-id: //depot/perl@7241
* Nits in perlmod.podDaniel Chetlin2000-09-301-2/+8
| | | | | Message-Id: <20000915020409.A2104@ilmd> p4raw-id: //depot/perl@7097
* note about compile failures and END blocks (from M.J.T. Guy)Gurusamy Sarathy2000-04-281-1/+1
| | | p4raw-id: //depot/perl@6007
* pod nits (from A. C. Yardley <yardley@tanet.net>)Gurusamy Sarathy2000-04-271-14/+14
| | | p4raw-id: //depot/perl@5957
* various pod nits (from Larry Virden and others)Gurusamy Sarathy2000-04-241-6/+6
| | | p4raw-id: //depot/perl@5917
* lexical warnings update for docs and tests (from Paul Marquess)Gurusamy Sarathy2000-03-131-0/+1
| | | p4raw-id: //depot/perl@5712
* s/STOP/CHECK/ blocksGurusamy Sarathy2000-01-261-3/+3
| | | p4raw-id: //depot/perl@4905