summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update perlfaq to CPAN version 5.0150037Chris 'BinGOs' Williams2012-01-0812-469/+182
| | | | | | | | | | | [DELTA] 5.0150037 Sun 8 Jan 2012 21:24:39 +0100 * Better XML parsing recommendations (apeiron) * Remove various old questions & update a few (ranguard) * Change auto generate of questions a bit (ranguard) * Autogenerate question index in perlfaq.pod (doherty) * Cleanups / typos, updating nested expressions (dami, reviewed by schwern)
* [perl #67490] Don’t call DELETE on scalar-tied elemFather Chrysostomos2012-01-082-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This little snippet: sub TIESCALAR{bless[]} sub STORE{} tie $^H{foo}, ''; $^H{foo} = 1; delete $^H{foo}; dies with ‘Can't locate object method "DELETE"...’. This bug was introduced for %^H by commit b3ca2e834c, but it is actu- ally an older bug that already affected %ENV before that. Clear-magic on a scalar is only called when it is an element of a mag- ical aggregate. For hashes, this clear-magic is called whenever the hash itself is RMAGICAL. Tied scalars and elements of tied aggregates use the same magic vta- ble, under the assumption that mg_clear will never be called on a tied scalar. That assumption is wrong. Commit b3ca2e834c is the one that made %^H magical, which is why it caused this problem for %^H. The obvious solution, giving tied scalars their own vtable, is not as simple as it sounds, because then tied scalars are no longer RMAGICAL, and at least some of the tie code assumes that they are. So the easiest fix is to skip the DELETE call in Perl_magic_clearpack if the type of magic is PERL_MAGIC_tiedscalar.
* Simplify magic logic in av.c:av_storeFather Chrysostomos2012-01-081-2/+1
|
* clarify how $SIG{__DIE__} can returnDavid Mitchell2012-01-081-4/+4
| | | | | | | It can return via 'goto &sub', but not via 'goto LABEL'. The docs originally just said 'via goto' See [perl #44367].
* perlfunc: spaces after dotsFather Chrysostomos2012-01-071-4/+4
|
* Make localtime()' s documentation more succinctTom Hukins2012-01-071-6/+2
| | | | | It's now twelve years since Y2K, so the documentation should not make such a fuss about it.
* [perl #85670] Copy magic to ary elems properlyFather Chrysostomos2012-01-062-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Tue Mar 08 07:26:35 2011, thospel wrote: > #!/usr/bin/perl -l > use Data::Dumper; > use Scalar::Util qw(weaken); > our @ISA; > > for (1..2) { > @ISA = qw(Foo); > weaken($a = \@ISA); > weaken($a = \$ISA[0]); > print STDERR Dumper(\@ISA); > } > > This prints: > $VAR1 = [ > 'Foo' > ]; > $VAR1 = [ > 'Foo', > \$VAR1->[0] > ]; > > So the first time it's the expected @ISA, but the second time round it > automagically added a reference to to the first ISA element > > (bug also exists in blead) Shorter: #!/usr/bin/perl -l use Scalar::Util qw(weaken); weaken($a = \@ISA); @ISA = qw(Foo); use Devel::Peek; Dump \@ISA; weaken($a = \$ISA[0]); print scalar @ISA; # prints 2 The dump shows the problem. backref magic is being copied to the ele- ment. Put the magic in a different order, and everything is fine: #!/usr/bin/perl -l use Scalar::Util qw(weaken); weaken($a = $b = []); *ISA = $a; @ISA = qw(Foo); use Devel::Peek; Dump \@ISA; weaken($a = \$ISA[0]); print scalar @ISA; # prints 2 This code in av_store is so wrong: if (SvSMAGICAL(av)) { const MAGIC* const mg = SvMAGIC(av); if (val != &PL_sv_undef) { sv_magic(val, MUTABLE_SV(av), toLOWER(mg->mg_type), 0, key); } if (PL_delaymagic && mg->mg_type == PERL_MAGIC_isa) PL_delaymagic |= DM_ARRAY_ISA; else mg_set(MUTABLE_SV(av)); } It doesn’t follow the magic chain at all. So anything magic could get attached to the @ISA array, and that will be copied to the element instead of isa magic. Notice that MUTABLE_SV(av) is the second argument to sv_magic, so mg->mg_obj for the element always points back to the array. Since backref magic’s mg->mg_obj points to the backrefs array, @ISA ends up being used as this element’s backrefs array. What if arylen_p gets copied instead? Let’s see: $#ISA = -1; @ISA = qw(Foo); $ISA[0] = "Bar"; main->ber; sub Bar::ber { warn "shave" } __END__ Can't locate object method "ber" via package "main" at - line 7. I’ve fixed this by making av_store walk the magic chain, copying any magic for which toLOWER(mg->mg_type) != mg->mg_type.
* [perl #107440] Save av/hv on mortals stack when clearingFather Chrysostomos2012-01-064-8/+25
| | | | | | | | | | | | | | | | | | | In pp_undef and pp_aassign, we should put the av or hv that is being cleared on the mortals stack (with an increased refcount), so that destructors fired during the clearing do not free the av or hv. I was going to put this in av_undef, etc., but pp_aassign also needs to access the aggregate after clearing it. We still get a crash with that approach. Putting the aggregate on the mortals stack in av_undef, av_clear and h_freeentries would work, too, but might cause the aggregate to leak too far. That may cause problems, e.g., if it is %^H, because it may last until the end of the current compilation unit. Directly inside a runloop (in a pp function), it should be OK to use the mortals stack, as it *will* be cleared ‘soon’. This seems the least intrusive approach.
* [perl #90632] perlfunc: Rewrite `split'Michael Witten2012-01-061-80/+114
| | | | | | | | | | | | | | | | | | | | | I couldn't stand the way the documenation for `split' was written; it felt like a kludge of broken English dumped into a messy pile by several people, each of whom was unaware of the other's work. This variation completes sentences, adds new ones, rearranges ideas, expands on ideas, simplifies and unifies examples, and includes more cross references. While the original text seemed to be written in a way that touched upon the arguments in reverse order (which did have a hint of elegance), this version attempts to provide the reader with the most useful information upfront. Thanks to Brad Baxter and Thomas R. Sibley for their constructive criticism. [Modified by the committer to incorporate suggestions from Aristotle Pagaltzis and Tom Christiansen.]
* document the upgrade of PerldocRicardo Signes2012-01-062-2/+7
|
* Pod-Perldoc now includes test documentsRicardo Signes2012-01-061-0/+4
| | | | do not test them as if they were Pod we ship
* Upgrade Pod-Perldoc to CPAN version 3.15_15Ricardo Signes2012-01-0626-909/+9814
|
* Uncomment evals in sort.tFather Chrysostomos2012-01-061-2/+2
| | | | | These were commented out temporarily during development. I forgot to uncomment them before committing.
* PerlIO::scalar: allow writing to SvIOK SVsFather Chrysostomos2012-01-052-4/+16
| | | | | | | It used to crash if the PVX buffer happened to be null. If the PVX buffer happened to be left over from before, it would use that instead of the numeric value, even for !SvPOK scalars.
* In PerlIO::Scalar’s write, stringify refsFather Chrysostomos2012-01-052-3/+9
| | | | Otherwise, it won’t work with an overloaded object.
* perlsyn: spaces after dotsFather Chrysostomos2012-01-051-18/+22
|
* regen pod issuesFather Chrysostomos2012-01-051-1/+0
|
* perlsyn: wrap long verbatim lineFather Chrysostomos2012-01-051-1/+2
|
* Increase $PerlIO::scalar::VERSION to 0.13Father Chrysostomos2012-01-051-1/+1
|
* perlsyn: Correct ... exampleFather Chrysostomos2012-01-051-2/+2
|
* [perl #92706] In PerlIO::Scalar::seek, don’t assume SvPOKpFather Chrysostomos2012-01-052-20/+21
| | | | | | | | | | | | | | | | | | | Otherwise we get assertion failures. In fact, since seeking might be just for reading, we can’t coerce and SvGROW either. In fact, since the scalar might be modified between seek and write, there is no *point* in SvGROW during seek, even for SvPOK scalars. PerlIO::scalar assumes in too many places that the scalar it is using is its own private scalar that nothing else can modify. Nothing could be farther from the truth. This commit moves the zero-fill that usually happens when seeking past the end from seek to write. During a write, if the current position is past the end of the string, the intervening bytes are zero-filled at that point, since the seek hasn’t done it.
* perlsyn: add triple-dot index entries and aliasFather Chrysostomos2012-01-051-1/+6
| | | | | | This adds the index entries to perlsyn that were removed in the previous commit, and mentions in perlsyn that the ellipsis is also called a triple-dot.
* perlop: remove triple-dotFather Chrysostomos2012-01-053-66/+12
| | | | | This has been superseded by c2f1e229, which adds it to perlsyn.
* [perl #90064] warn once for dbmopen with undef 3rd argFather Chrysostomos2012-01-052-1/+11
|
* Increase $overload::VERSION to 1.17Father Chrysostomos2012-01-051-1/+1
|
* regen pod issuesFather Chrysostomos2012-01-051-1/+1
|
* Correct links to perlsyn and perlopFather Chrysostomos2012-01-057-11/+11
|
* [perl #90926] Corrections to the previous patchTom Christiansen2012-01-051-2/+2
| | | | | Here is a patch against the second patch, fixing typos reported to me.
* [perl #90926] smartmatch PATCH 2 of 2: perlsyn.podTom Christiansen2012-01-051-389/+565
| | | | | | As previously explained, this patch against perlsyn is part and parcel of the previous one against perlop (two commits ago; perl #90906).
* [perl #90906] Corrections to the previous patchTom Christiansen2012-01-051-13/+13
| | | | | Here is a patch against the first patch, fixing typos reported to me.
* [perl #90906] smartmatch PATCH 1 of 2: perlop.podTom Christiansen2012-01-051-51/+392
| | | | | | | The thrust of this patch is to move the description of the ~~ operator into perlop where it properly belongs; given and when remain relegated to perlsyn. This is also (nearly) the first-ever set of examples for the smartmatch operator. Staggerment.
* Update CPANPLUS to CPAN version 0.9116Chris 'BinGOs' Williams2012-01-0631-32/+43
| | | | | | | | | | [DELTA] Changes for 0.9116 Thu Jan 5 22:45:06 2012 ================================================ * add NAME headings in modules with POD, Debian Lintian fixes, http://bugs.debian.org/65045 * Implement reload command in the shell
* [perl #91850] utf8::decode: croak for ro scalarsFather Chrysostomos2012-01-052-1/+12
|
* [perl #90064] perlfunc: Document special 0 mode for dbmopenFather Chrysostomos2012-01-051-1/+4
|
* [perl #90648] perlop: There is no low-prec //H.Merijn Brand2012-01-051-2/+4
|
* [perl #90648] perlop: There ain’t no C-style //Father Chrysostomos2012-01-051-1/+1
|
* regen pod issuesFather Chrysostomos2012-01-051-2/+2
|
* perlfunc: spaces after dotsFather Chrysostomos2012-01-051-112/+123
|
* cflags does not exists in Config.pm; use ccflagsambs2012-01-0513-13/+14
| | | | | | [dagolden bumped $VERSION and added ambs to the AUTHORS file] Signed-off-by: David Golden <dagolden@cpan.org>
* [perl #90030] sort with no argumentsFather Chrysostomos2012-01-053-4/+13
| | | | | | | | | | | | | | | | | | | This eliminates the error ‘sort is now a reserved word’, which was added for the sake of code that does close(sort) at about the time that sort became a keyword. As Tom Christiansen pointed out, it has been long enough. This error only occurred with ) or ; after the keyword. In other cases with no arguments, like {sort} and (sort,0), it was treated as an empty list. So this commit makes it follow that. Since the tests triggered it, this commit also fixes a crash caused by commit 540dd770, which, when seeing whether it can optimise something like ‘@a = sort @a’, assumes that there is something after the sort, and crashes when there isn’t, as in {@a = sort}.
* [perl #89758] important perlfunc version guardsTom Christiansen2012-01-041-46/+125
| | | | | | | | | | | This reminds users to put version guards on their neologisms. We're changing Perl's basic sytnax a great deal, and users need to understand that to use those syntactic changes will cause weird errors if they don't put this sort of thing in. This sort of thing really should have gone in all along. Let's please continue what I have begun. I also fixed the order: untie does not precede unshift. :(
* [perl #97464] Document actual case when @DB::args is setFather Chrysostomos2012-01-041-1/+2
|
* [perl #95548] Returned magical temps are not copiedFather Chrysostomos2012-01-043-5/+25
| | | | | | | | | | | return and leavesub, for speed, were not copying temp variables with a refcount of 1, which is fine as long as the fact that it was not cop- ied is not observable. With magical variables, that *can* be observed, so we have to forego the optimisation and copy the variable if it’s magical. This obviously applies only to rvalue subs.
* Don’t iterate through magic with local $_Father Chrysostomos2012-01-041-1/+3
| | | | | If we are going to skip all set-magic when restoring a localised tied $_, there’s no point in looping through it.
* Restrict $[ comp warning to constantsFather Chrysostomos2012-01-042-2/+24
| | | | | | $#a > $[ is a legitimate use of $[ with >. So warning in that case is not nice. Most version comparisons are done with constants, like 5.006, so warn only for constants.
* miniperl can no longer run installperl.Craig A. Berry2012-01-041-2/+3
| | | | | | | | installperl now requires Porting/pod_lib.pl, which uses Digest::MD5, which means we need something that can do dynamic loading (or has extensions statically linked in). But it doesn't really matter because presumably we wouldn't be installing Perl if we hadn't built it, so use the perl we've built rather than miniperl.
* hv.c pod: 'Perl_sv_placeholder' should be 'PL_sv_placeholder'Karl Williamson2012-01-041-1/+1
|
* Remove some dead x2p-related code in vmsish.h.Nicholas Clark2012-01-041-54/+4
|
* [perl #105912] local $_ should not FETCHFather Chrysostomos2012-01-032-4/+5
| | | | | This commit finishes the work of 658a9f3 by skipping FETCH as well as STORE during local($_).
* Correct bug-report email in IO docsFather Chrysostomos2012-01-037-14/+15
| | | | This was mentioned in ticket #75156.