summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make pod2html a regular script without substitutionsFlorian Ragwitz2011-08-279-52/+75
| | | | | | This will make the CPAN dist easier. For the perl core, we still need substitutions to get the right she-bang as we don't go through EU::MM to fix it for us. For that, we add utils/pod2html.PL.
* Give Pod-Html a more modern dist layoutFlorian Ragwitz2011-08-272-17/+17
|
* &CORE::reset()Father Chrysostomos2011-08-263-2/+17
| | | | | | | | This commit allows &CORE::reset to be called through references and via ampersand syntax. pp_reset is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell reset how many arguments it’s actually getting. See commit 0163043a for details.
* GVs of localised arrays and hashes should be refcountedFather Chrysostomos2011-08-263-5/+18
| | | | | | | | | | Otherwise the GV can be freed before the scope-popping code can put the old entry back in it: $ perl -le 'local @{"x"}; delete $::{x}' Bus error $ perl -le 'local %{"x"}; delete $::{x}' Bus error
* &CORE::foo() for (sys)read and recvFather Chrysostomos2011-08-264-7/+59
| | | | | | | | | | | | | | These are grouped together because they all have \$ in their prototypes. This commit allows the subs in the CORE package under those names to be called through references and via &ampersand syntax. The coreargs op in the subroutine is marked with the OPpSCALARMOD flag. (scalar_mod_type in op.c returns true for these three ops, indicating that the OA_SCALARREF parameter is \$, not \[$@%(&)*].) pp_coreargs uses that flag to decide what arguments to reject.
* Add OPpCOREARGS_SCALARMOD flagFather Chrysostomos2011-08-262-1/+2
| | | | | pp_coreargs will use this to distinguish between the \$ and \[$@%*] prototypes.
* Update the comments at the top of t/op/core*.tFather Chrysostomos2011-08-262-7/+4
|
* Rename t/op/core*.tFather Chrysostomos2011-08-264-795/+795
| | | | | | | | Originally, coresubs.t was going to be for generic tests and coreinline.t was going to be for inlining. But the latter ended up testing other things than inlining, the former testing just &ampersand() calls. So this commits renames coresubs.t to coreamp.t and coreinline.t to coresubs.t.
* &CORE::rand()Father Chrysostomos2011-08-263-1/+11
| | | | | | | | This commit allows &CORE::rand to be called through references and via ampersand syntax. pp_rand is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell rand how many arguments it’s actually getting. See commit 0163043a for details.
* &CORE::open()Father Chrysostomos2011-08-263-5/+25
| | | | | | This commit allows &CORE::open to be called through references or with ampersand syntax. It modifies pp_coreargs not to push nulls for ops that require a pushmark.
* Reverse the order of two tests in gv.tFather Chrysostomos2011-08-261-1/+1
| | | | | | so that the first does not make the second always pass. The bug that 99fc7eca4 fixed would never had occurred if they had been that way to begin with.
* &CORE::mkdir()Father Chrysostomos2011-08-263-2/+25
| | | | | | | | This commit allows &CORE::mkdir to be called through references and via ampersand syntax. pp_mkdir is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell mkdir how many arguments it’s actually getting.
* &CORE::lock()Father Chrysostomos2011-08-264-3/+49
| | | | | | | | | | | | | This commit allows &CORE::lock to be called through references and via ampersand syntax. It adds code to pp_coreargs for handling the OA_SCALARREF case, though what it adds is currently lock-specific. (Subsequent commits will address that.) Since lock returns the scalar passed to it, not a copy, &CORE::lock needs to use op_leavesublv, rather than op_leavesub. But it can’t be an lvalue sub, as &CORE::lock = 3 should be disallowed. So we use the sneaky trick of turning on the lvalue flag before attaching the op tree to the sub (which causes newATTRSUB to use op_leavesublv), and then turning it off afterwards.
* &CORE::index() and &CORE::rindex()Father Chrysostomos2011-08-263-4/+19
| | | | | | | | This commit allows &CORE::index and &CORE::rindex to be called through references and via ampersand syntax. pp_index is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell pp_index how many arguments it’s actually getting. See commit 0163043a for details.
* Update UNIVERSAL::VERSION docs following 9bf41c1Father Chrysostomos2011-08-261-4/+3
|
* &CORE::gmtime() and &CORE::localtime()Father Chrysostomos2011-08-263-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows &CORE::gmtime and &CORE::localtime to be called through references and via ampersand syntax. pp_gmtime is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell pp_gmtime how many arguments it’s actually getting. I was going to say ‘see commit f6a1686942 for more details’, but found out, to my horror, that most of the commit message was cut off. I don’t know which commit-munging part of git is responsible, but I’ve had similar problems with git am and git commit --amend. But, then, this could have been sloppy copy and paste. Anyway, here is the missing part: Usually, an op that has optional arguments has the number of arguments indicated with flags on the op itself: $ ./perl -Ilib -MO=Concise -e 'binmode 1' 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 5 <@> binmode vK/1 ->6 - <0> ex-pushmark s ->3 4 <1> rv2gv sK*/1 ->5 3 <$> gv(*1) s ->4 -e syntax OK $ ./perl -Ilib -MO=Concise -e 'binmode 1,2' 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 6 <@> binmode vK/2 ->7 - <0> ex-pushmark s ->3 4 <1> rv2gv sK*/1 ->5 3 <$> gv(*1) s ->4 5 <$> const(IV 2) s ->6 -e syntax OK Notice the /1 vs /2 on the binmode op. With a CORE sub, we have a single op for both cases. So, what this commit does is set the number of arguments to the maximum, push nulls on to the stack in pp_coreargs (actually, it was already set up to do it, so there is no change there), and have the pp_ functions for each op that has optional arguments do a null check after popping the stack. pp_binmode already does a null check, but other pp_ functions will need to be modified. Since each one is different, those will come in separate commits. This is what &CORE::binmode’s op tree looks like: $ ./perl -Ilib -MO=Concise,CORE::binmode -e 'BEGIN{\&CORE::binmode}' CORE::binmode: 3 <1> leavesub[1 ref] K/REFC,1 ->(end) 2 <@> binmode sK/2 ->3 - <0> ex-pushmark s ->1 1 <$> coreargs(IV 212) s ->2 -e syntax OK
* perldelta for f132ae69 (*{undef})Father Chrysostomos2011-08-261-0/+9
|
* Remove now-unnecessary len check from pp.c:S_rv2gvFather Chrysostomos2011-08-261-2/+1
| | | | | This check, added by ed996e63f6, is no longer necessary as of commit f132ae694c, since PL_sv_undef takes a different path.
* Make *{undef} self-consistentFather Chrysostomos2011-08-263-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Commit afd1915d made filehandle vivification work on hash and array elements, but in doing so it accidentally changed *{;undef} = 3; to do the same thing as *{""} = 3; while leaving *{$some_undefined_variable} an error. This commit adjusts the if() conditions in S_rv2gv (formerly in pp_rv2gv) in pp.c to make PL_sv_undef follow the same path as before. It also removes the uninit tests from lib/warnings/pp, since they are now errors. The uninit warning in rv2gv is only triggered now when it is implicit, as in close(). That is already tested in lib/warnings/9uninit.
* perlop: Minor consistency tweakFather Chrysostomos2011-08-261-2/+2
| | | | | Make the indentation in this example match the surrounding examples.
* [perl #93358] Clarify => quotingFather Chrysostomos2011-08-261-2/+11
| | | | | | | The perlop manpage was stating ‘the left operand’, which was not entirely correct, as ‘time.shift =>’ quotes just the shift, not the time (nor does it see the whole as not being an ident- ifier and refuse to quote anything).
* Re-generate uconfig.hFlorian Ragwitz2011-08-261-4/+4
| | | | This makes porting/regen.t pass again.
* Bump the perlfaq version for a new cpan releaseFlorian Ragwitz2011-08-262-2/+2
|
* Remove unwanted space in commentsH.Merijn Brand2011-08-261-3/+3
|
* Revert "Fix Configure's csym test for gcc's link time optimisation"H.Merijn Brand2011-08-261-8/+8
| | | | | | There are too many related problems arising from this change This reverts commit e820c6d6a6d0a8828aa68a6895696b659c471f2f.
* Correct mro_get_linear_isa’s docsFather Chrysostomos2011-08-251-4/+3
| | | | | This has been out of date since the MRO plugin API was added (5.10.1, I think).
* &CORE::getpgrp()Father Chrysostomos2011-08-253-3/+12
| | | | | | | This commit allows &CORE::getpgrp to be called through references and via ampersand syntax. pp_getpgrp is modified to take into account the nulls pushed on to the stack in pp_coreargs, since pp_coreargs has no other way to tell getpgrp how many arguments it’s actually getting.
* &CORE::exit()Father Chrysostomos2011-08-253-1/+9
| | | | | | | This commit allows &CORE::exit to be called through references and via ampersand syntax. pp_exit is modified to take into account the nulls pushed on to the stack in pp_coreargs, since pp_coreargs has no other way to tell exit how many arguments it’s actually getting.
* pp.c: Suppress stupid compiler warningFather Chrysostomos2011-08-251-1/+1
|
* &CORE::foo() for dbmopen and dbmcloseFather Chrysostomos2011-08-254-3/+51
| | | | | | | | | | This commit allows the subs in the CORE package for close, getc and readline to be called through references and via ampersand syntax. A special case for each of them is added to pp_coreargs to deal with calls with no arguments. Pushing a null on to the stack (which I’m doing for other ops) won’t work, as a null already means something for these cases: close($f) won’t vivify a typeglob if $f is a string, so the implicit rv2gv pushes a null on to the stack.
* &CORE::foo() for close, getc and readlineFather Chrysostomos2011-08-255-10/+91
| | | | | | | This commit allows the subs in the CORE package for close, getc and readline to be called through references and via ampersand syntax. The pp functions are modified to take into account the nulls that coreargs pushes on to the stack to indicate that there is no argument.
* void rather than empty parameter for Perl___notused.Craig A. Berry2011-08-251-1/+1
| | | | | | | | | | | | | | | | | Without this, the VMS compiler, with warnings cranked up to level 4, emits pages and pages of things like: dVAR; ....^ %CC-I-NOPARMLIST, The declaration of the function Perl___notused has an empty parameter list. If the function has parameters, they should be declared here; if it has no parameters, "void" should be specified in the parameter list. at line number 100 in file MDA0:[SMOKE.blead]perl.c;1 Over 2,000 of these plus other warnings yields a smoke report of 750K, which is quite a bit over the 400K limit of the perl.org mailing lists, not to mention being a slow read.
* [perl #92376] Change - to : in time templateFather Chrysostomos2011-08-251-1/+1
|
* &CORE::foo() for @ and $@ prototypes, except unlinkFather Chrysostomos2011-08-255-11/+115
| | | | | | | | | | | | | | This commit allows the CORE subroutines for functions with @ and $@ prototypes to be called through references and via amper- sand syntax. unlink is not included in this commit, as it requires special casing due to its use of implicit $_. Since these functions require a pushmark, and since it has to come between two things that pp_coreargs does, it’s easiest to flag the coreargs op (with the OPpCOREARGS_PUSHMARK flag added in the previous commit) and call pp_pushmark directly from pp_coreargs.
* Add OPpCOREARGS_PUSHMARK flagFather Chrysostomos2011-08-252-1/+2
| | | | | | | | | This will be used to tell pp_coreargs when it needs to call pp_pushmark. For those functions that need a pushmark, it has to come between two things that pp_coreargs does; so the easiest way is to use this flag.
* &CORE::caller()Father Chrysostomos2011-08-255-6/+33
| | | | | | | | | | | | | | This commit allows &CORE::caller to be called through references and via ampersand syntax. pp_caller is modified to take into account two things: 1) pp_coreargs pushes a null on to the stack, since it has no other way to tell caller whether it has an argument. 2) The value coming from pp_coreargs (when not null) is off by one. The OPpOFFYBONE flag was added in commit 93f0bc4935 for this purpose. pp_coreargs is also modified, since it assumed till now that an optional first argument was an implicit $_.
* &CORE::bless()Father Chrysostomos2011-08-253-2/+11
| | | | | | | This commit allows &CORE::bless to be called through references and via ampersand syntax. pp_bless is modified to take into account the nulls pushed on to the stack in pp_coreargs, since pp_coreargs has no other way to tell bless how many arguments it’s actually getting.
* &CORE::binmode()Father Chrysostomos2011-08-253-2/+25
| | | | | | | | This commit allows &CORE::binmode to be called through references and via ampersand syntax. Usually, an op that has optional arguments has the number of arguments indicated with flags on the op itself:
* [perl #93320] localising @DB::args leads to coredumpFather Chrysostomos2011-08-253-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This script, from the RT ticket, crashes: #!/usr/bin/perl sub cl{ package DB; @DB::args = (); return caller(shift); } sub f{ local @DB::args; my @z = cl($_) for (1..3); } f(1,2,3); f(1,2,3); __END__ PL_dbargs is not refcounted, and it’s not set until pp_caller first tries to write to it. If that happens when @DB::args is localised, then the array will be freed on scope exit, leaving PL_dbargs pointing to a freed SV. This crash can be reproduced more simply this way: sub { package DB; ()=caller(0); undef *DB::args; ()=caller(0); }->(); So, basically, pp_caller has to re-fetch PL_dbargs from the %DB:: stash each time it sets it. It cannot rely on the cached value. (So now I’m wondering whether we even need PL_dbargs.)
* Allow ampersand calls for CORE subs with $*$$**$ protosFather Chrysostomos2011-08-254-24/+108
| | | | | | | | | | | | | | | | | | | | This enables ampersand calls and calls through references for CORE subs that have * and $ in their prototypes and a fixed number of arguments. Usually, the *-prototyped ops have their child ops wrapped in rv2gv’s (*{}) implicitly. The rv2gv op is sometimes flagged as an autoviv- ificatory op, such as the first argument to accept() or open(). S_is_handle_constructor contains the list of ops that turn on that flag. This commit makes the coreargs op use a couple of flags to serve the same purpose. pp_coreargs itself calls S_rv2gv (split out from pp_rv2gv recently for precisely this purpose) with arguments based on its own flags. Currently the autovivified glob gets a name like main::_GEN_0 instead of main::$a. I think we can live with that.
* Add private coreargs flags for vivifying GVsFather Chrysostomos2011-08-252-1/+7
|
* Move most of pp_rv2gv into a static functionFather Chrysostomos2011-08-251-16/+44
| | | | | This allows the glob-deref logic to be use by other functions in pp.c, like pp_coreargs.
* Add Frederic Briere to AUTHORSFather Chrysostomos2011-08-251-0/+1
|
* Attribute::Handlers: "my" should be "till"Frederic Briere2011-08-251-1/+1
|
* Attribute::Handlers: correct spellingFather Chrysostomos2011-08-251-5/+5
|
* Dumper.xs: Suppress compiler warningFather Chrysostomos2011-08-252-3/+3
|
* coresubs.t: Minor clean-upFather Chrysostomos2011-08-251-7/+2
| | | | | This fixes some infelicities in the new tests I added to this file recently.
* Invert the list of &-able functions in gv.cFather Chrysostomos2011-08-251-31/+30
| | | | | | The list of those that do not support &CORE::foo() syntax is now shorter than the list of those that do. In subsequent commits it will get even shorter.
* Make sure coresubs.t tests all &-able funcsFather Chrysostomos2011-08-251-0/+29
|
* replace old bookmarks.cpan link with www.perl.org and learn.perl.orgLeo Lapworth2011-08-251-1/+2
|