This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
13 years agoTidy up ext/Opcode/t/Opcode.t.
Nicholas Clark [Tue, 9 Nov 2010 13:24:41 +0000 (13:24 +0000)]
Tidy up ext/Opcode/t/Opcode.t.

Convert a loop with a die into regular tests. Don't declare lexicals ahead of
use. Don't even declare a lexical @o3, which isn't used.

13 years agoConvert ext/Opcode/t/Opcode.t to Test::More.
Nicholas Clark [Tue, 9 Nov 2010 13:09:29 +0000 (13:09 +0000)]
Convert ext/Opcode/t/Opcode.t to Test::More.

The tests (including the still-TODO) mostly date from 1996.

13 years agoFix error in tryAMAGICunDEREF() introduced in 25a9ffce153b0e67.
Nicholas Clark [Tue, 9 Nov 2010 10:40:40 +0000 (10:40 +0000)]
Fix error in tryAMAGICunDEREF() introduced in 25a9ffce153b0e67.

tryAMAGICunDEREF() isn't used anywhere in the core. Add tests for it.

13 years agoauthorial perlipc edit
Tom Christiansen [Tue, 9 Nov 2010 06:00:00 +0000 (22:00 -0800)]
authorial perlipc edit

Looking through perlipc to make little fixes, it quickly became clear to me
that it had been patched with code by people with a Perl coding style, and
sometimes with an English language style, both very different to my own.

This made it seem like an old patchwork tattercloth that didn't fit
together very well.  It was confusing and detracted from the overall
message.  I've tried to fix all this.  I started with a recent git pull
and edited.  The result is something that is once again internally
self-consistent.

13 years agoDelete paragraphs from mro.pm’s pod
Father Chrysostomos [Tue, 9 Nov 2010 04:12:52 +0000 (20:12 -0800)]
Delete paragraphs from mro.pm’s pod
which are no longer relevant

13 years ago[perl #75176] Symbol::delete_package does not free certain memory associated with...
Father Chrysostomos [Tue, 9 Nov 2010 03:24:07 +0000 (19:24 -0800)]
[perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA

This commit makes @ISA changes and package aliasing update PL_isarev
properly, removing old, unnecessary entries in addition to adding new
entries. So now it is capable of shrinking, not just growing.

------------
Gory Details
------------

There is a chicken-and-egg problem when it comes to calling
mro_isa_changed_in on the affected classes: When an isa linearisation
is recalculated, it uses the existing linearisations of the super-
classes (if any) (or at least the DFS implementation does). Since an
assigned package (e.g., the *b:: in *a:: = *b::) can contain nested
packages that inherit from each other in any order (b::c isa b::c::d
or b::c::e isa b::c), this means that mro_isa_changed_in *must not* be
called on any stash while another stash contains stale data.

So mro_package_moved has been restructured. It is no longer recurs-
ive. The recursive code for iterating through nested stashes has been
moved into a separate, static routine: mro_gather_and_rename. Instead
of calling mro_isa_changed_in during the iteration, it adds all the
classes to ‘the big hash’, which mro_package_moved holds a pointer to.
When mro_gather_and_rename returns, mro_package_moved iterates through
the big hash twice: the first time to wipe caches; the second to call
mro_isa_changed_in on all the stashes.

This ‘big hash’ is now used in place of the seen_stashes that
mro_package_moved used before.

Both mro_package_moved and mro_isa_changed_in now use the existing
mrometa->isa hash to determine which classes used to be superclasses
of the stash in question. A separate routine, S_mro_clean_isarev,
deletes entries mention in isa, except for those that still exist in
the new isa hash.

mro_isa_changed_in now does two iterations through isarev, just like
mro_package_moved. It has to call get_linear_isa on the subclasses so
that it can see what is in the new meta->isa hash created thereby.
Consequently, it has to make sure that all the subclasses have their
caches deleted before it can update anything. It makes the same
changes to isarev for each subclass that are made further down on the
class for which mro_isa_changed_in was called. Yes, it is repetitive.
But calling mro_isa_changed_in recursively has more overhead and would
do more unnecessary work. (Maybe we could make some macros for this
repetitive code.)

The loop through the superclasses near the end of mro_isa_changed_in
no longer adds the subclasses to all the superclasses’ isarev hashes,
because that is taken care of further up.

------------
Side Effects
------------

One result of this change is that mro::is_universal no longer
returns true for classes that are no longer universal. I consider
that a bug fix.

-------------
Miscellaneous
-------------

This also removes obsolete comments in mro_isa_changed_in, concerning
fake and universal flags on stashes, that have been invalid since
dd69841bebe.

13 years agoUpdate CGI.pm to CPAN version 3.50
Chris 'BinGOs' Williams [Tue, 9 Nov 2010 00:20:53 +0000 (00:20 +0000)]
Update CGI.pm to CPAN version 3.50

  [DELTA]

  Version 3.50

  [SECURITY]
  1. The MIME boundary in multipart_init is now random.
     Thanks to Byron Jones, Masahiro Yamada, Reed Loden, and  Mark Stosberg
  2. Further improvements to handling of newlines embedded in header values.
     An exception is thrown if header values contain invalid newlines.
     Thanks to Michal Zalewski, Max Kanat-Alexander, Yanick Champoux,
     Lincoln Stein, Fr�d�ric Buclin and Mark Stosberg

  [DOCUMENTATION]
  1. Correcting/clarifying documentation for param_fetch(). Thanks to
        Ren�e B�cker. (RT#59132)

  [INTERNALS]
  1. Fixing https test in http.t. (RT#54768)
  2. Tests were added for multipart_init(). Thanks to Mark Stosberg and CGI::Simple.

13 years agoCorrect Math::BigInt::FastCalc version in perldelta
Florian Ragwitz [Mon, 8 Nov 2010 19:48:40 +0000 (20:48 +0100)]
Correct Math::BigInt::FastCalc version in perldelta

13 years agoUpgrade Math::BigInt to version 1.98
Florian Ragwitz [Mon, 8 Nov 2010 19:47:40 +0000 (20:47 +0100)]
Upgrade Math::BigInt to version 1.98

13 years agoAdd Fingle Nark to AUTHORS
Father Chrysostomos [Mon, 8 Nov 2010 17:40:19 +0000 (09:40 -0800)]
Add Fingle Nark to AUTHORS

13 years agoExcluding tests in sub-dirs
Jerry D. Hedden [Tue, 2 Nov 2010 14:47:28 +0000 (10:47 -0400)]
Excluding tests in sub-dirs

For modules that are not built, exclude tests in sub-directories under
/t.  For example: cpan/Module-Build/t/actions/installdeps.t

13 years agotypos in comments/pod
Fingle Nark [Mon, 8 Nov 2010 17:29:56 +0000 (09:29 -0800)]
typos in comments/pod

13 years agoAvoid a declaration after statement, accidentally added by 6079961fee8cf49c.
Nicholas Clark [Mon, 8 Nov 2010 14:43:29 +0000 (14:43 +0000)]
Avoid a declaration after statement, accidentally added by 6079961fee8cf49c.

Code in ext/ isn't subject to the same compiler warnings regime as the
top-level core files, hence why this was missed.

13 years agoIn B.xs, remove the now unused first argument from make_sv_object().
Nicholas Clark [Mon, 8 Nov 2010 14:18:54 +0000 (14:18 +0000)]
In B.xs, remove the now unused first argument from make_sv_object().

After the previous change, all callers were passing in NULL and letting it
generate a new mortal SV for them.

13 years agoIn B.xs, use PPCODE rather than a typemap for output of T_SV_OBJ
Nicholas Clark [Mon, 8 Nov 2010 13:53:53 +0000 (13:53 +0000)]
In B.xs, use PPCODE rather than a typemap for output of T_SV_OBJ

This actually reduces both source code size and object code size (the latter
by almost 1K on this platform).

13 years agoB::MAGIC::LENGTH(), not B::MAGIC::LEN(). Fixes #78864
Nicholas Clark [Mon, 8 Nov 2010 13:03:13 +0000 (13:03 +0000)]
B::MAGIC::LENGTH(), not B::MAGIC::LEN(). Fixes #78864

b2adfa9b5e1682df inadvertently changed the name of the accessor for
mg->mg_len to B::MAGIC::LENGTH. Fix this.

13 years agoIn B.xs refactor cc_opclassname() to make_op_object().
Nicholas Clark [Mon, 8 Nov 2010 11:54:25 +0000 (11:54 +0000)]
In B.xs refactor cc_opclassname() to make_op_object().

All bar one of the callers to cc_opclassname() were using it in the same way -
to pass as the second argument of newSVrv(), whose first argument was a new
mortal, and return value was used with sv_setiv() and PTR2IV(). So clearly
*that* is the common code needed.

Inline the existing code (all 1 line of it) in the other location that called
cc_opclassname(). As the typemap was using cc_opclassname(), replace the 4
implicit uses of it with explicit PPCODE sections. Curiously, removing the use
of this typemap actually reduces the line count of B.xs

On this platform, this reduces the object code size by almost .5K.

13 years agoMerge the implementation of B::COP::{io,warnings} using ALIAS.
Nicholas Clark [Mon, 8 Nov 2010 09:31:39 +0000 (09:31 +0000)]
Merge the implementation of B::COP::{io,warnings} using ALIAS.

On this platform, this reduces the object size by about .5K.

13 years agoIn B.xs, refactor make_warnings_object() to take a COP * instead of STRLEN *.
Nicholas Clark [Mon, 8 Nov 2010 09:13:27 +0000 (09:13 +0000)]
In B.xs, refactor make_warnings_object() to take a COP * instead of STRLEN *.

13 years agoMerge the implementation of B::COP::{filegv,stash} using ALIAS.
Nicholas Clark [Mon, 8 Nov 2010 08:12:39 +0000 (08:12 +0000)]
Merge the implementation of B::COP::{filegv,stash} using ALIAS.

On this platform, this reduces the object size by about 400 bytes for a threaded
build.

13 years agoMerge the implementation of B::COP::{file,stashpv} using ALIAS.
Nicholas Clark [Sun, 7 Nov 2010 22:00:20 +0000 (22:00 +0000)]
Merge the implementation of B::COP::{file,stashpv} using ALIAS.

On this platform, this reduces the object size by about .5K, for an unthreaded
build.

13 years agoMerge the implementation of B::BM::TABLE with B::PV::{PV,PVX,PVBM} using ALIAS.
Nicholas Clark [Sun, 7 Nov 2010 17:33:42 +0000 (17:33 +0000)]
Merge the implementation of B::BM::TABLE with B::PV::{PV,PVX,PVBM} using ALIAS.

On this platform, this reduces the object code size by about .5K.

13 years agoRemove unneeded PREFIXes from B.xs.
Nicholas Clark [Sun, 7 Nov 2010 17:17:06 +0000 (17:17 +0000)]
Remove unneeded PREFIXes from B.xs.

13 years agoMerge the implementation of B::PV::PVBM with PVX and PV, using ALIAS.
Nicholas Clark [Sun, 7 Nov 2010 16:47:45 +0000 (16:47 +0000)]
Merge the implementation of B::PV::PVBM with PVX and PV, using ALIAS.

13 years agoMerge the implementation of B::PV::{PVX,PV} using ALIAS.
Nicholas Clark [Sun, 7 Nov 2010 16:14:17 +0000 (16:14 +0000)]
Merge the implementation of B::PV::{PVX,PV} using ALIAS.

On this platform, this reduces the object size by .5K.

13 years agoRefactor B::PV::PV to use newSVpvn_flags() for both arms of the if.
Nicholas Clark [Sun, 7 Nov 2010 15:19:15 +0000 (15:19 +0000)]
Refactor B::PV::PV to use newSVpvn_flags() for both arms of the if.

newSVpvn_flags(NULL, whatever, SVs_TEMP) is equivalent to sv_newmortal().

13 years agoMerge the implementation of B::REGEXP::{REGEXP,precomp} using ALIAS.
Nicholas Clark [Sun, 7 Nov 2010 15:03:43 +0000 (15:03 +0000)]
Merge the implementation of B::REGEXP::{REGEXP,precomp} using ALIAS.

13 years agoIn B::REGEX::precomp, use newSVpvn_flags() instead of newSVpvn().
Nicholas Clark [Sun, 7 Nov 2010 10:36:57 +0000 (10:36 +0000)]
In B::REGEX::precomp, use newSVpvn_flags() instead of newSVpvn().

Using newSVpvn_flags() and SVt_TEMP and an explicit push is one API call.
newSVpvn() and RETVAL results in a second API call, sv_2mortal(), in the return
typemap.

13 years agoIn B.xs, move the version dependant regexp code to be adjacent.
Nicholas Clark [Sun, 7 Nov 2010 10:20:36 +0000 (10:20 +0000)]
In B.xs, move the version dependant regexp code to be adjacent.

13 years agoMove the aliasing of B::IV::RV as B::PV::RV from XS to Perl code.
Nicholas Clark [Sun, 7 Nov 2010 09:56:50 +0000 (09:56 +0000)]
Move the aliasing of B::IV::RV as B::PV::RV from XS to Perl code.

This results in the same CV being used twice, rather than two CVs being created
that point to the same XS code implementation, shrinking the memory usage of B
slightly (168 bytes on this platform). It also is fewer source lines. :-)

13 years agoregexec.c: Don't give up on fold matching early
Karl Williamson [Sun, 7 Nov 2010 22:25:31 +0000 (15:25 -0700)]
regexec.c: Don't give up on fold matching early

As noted in the comments of the code, "a" =~ /[A]/i doesn't work currently
(except that regcomp.c knows about the ASCII characters and corrects for
it, but not always, for example in cases like "a" =~ /\p{Upper}/i.  This
patch catches all those).

It works by computing a list of all characters that (singly) fold to
another one, and then checking each of those.  The maximum length of
the list is 3 in the current Unicode standard.

I believe that a better long-term solution is to do this at compile
rather than execution time, by generating a closure of everything
matched.  But this can't be done now because the data structure would
need to be extensively revamped to list all non-byte characters, and
user-defined \p{} matches are not known at compile-time.

And it doesn't handle the multi-char folds.  There is a separate ticket
for those.

13 years agoregexec.c: change variable name to its purpose
Karl Williamson [Sun, 7 Nov 2010 21:17:27 +0000 (14:17 -0700)]
regexec.c: change variable name to its purpose

13 years agoutf8.c: Add function to create inversion of swash
Karl Williamson [Sun, 7 Nov 2010 22:40:40 +0000 (15:40 -0700)]
utf8.c: Add function to create inversion of swash

This adds _swash_inversion_hash() which takes a mapping swash and returns
a hash that is the inverse relation.  That is, given a code point, it
allows quick lookup of all code points that map to it.

The function is not for public use, as it will likely be revised, so is
not in the public API, and it's name begins with underscore.

It does not deal with multi-char mappings at this time, nor other swash
complications.

13 years agoutf8.c: extract code into separate subroutine
Karl Williamson [Sat, 6 Nov 2010 18:53:23 +0000 (12:53 -0600)]
utf8.c: extract code into separate subroutine

This patch moves the code that reads a single line from the main body of
an input Unicode property table into a separate subroutine.  This is in
preparation for using it from another place

13 years agoutf8.c: Add comments
Karl Williamson [Sat, 6 Nov 2010 16:24:42 +0000 (10:24 -0600)]
utf8.c: Add comments

I added comments as I was reading the code trying to understand it

13 years agoUpdate File-Fetch to CPAN version 0.28
Chris 'BinGOs' Williams [Sun, 7 Nov 2010 23:36:01 +0000 (23:36 +0000)]
Update File-Fetch to CPAN version 0.28

  [DELTA]

  Changes for 0.28        Sun Nov  7 21:22:26 2010
  =================================================
  * Added support for FreeBSDs 'fetch' command for
    both http and ftp schemes.

13 years agorefactor GRAMPROG grammar slightly
Zefram [Tue, 26 Oct 2010 19:47:51 +0000 (20:47 +0100)]
refactor GRAMPROG grammar slightly

Shift the structure of the GRAMPROG production (whole-file grammar)
to more closely match that of the other top-level productions.

13 years agoFix an out of bounds write in Data-Dumper with malformed utf8 input
Niko Tyni [Sat, 6 Nov 2010 19:44:35 +0000 (21:44 +0200)]
Fix an out of bounds write in Data-Dumper with malformed utf8 input

When warnings are enabled and Dumper() is called with an invalid utf8
string that still has the UTF8 flag on, esc_q_utf8() miscounts the size
of the escaped string.

13 years agoCorrect grouping in S_reginclass
Florian Ragwitz [Sun, 7 Nov 2010 15:41:53 +0000 (16:41 +0100)]
Correct grouping in S_reginclass

As pointed out by Karl Williamson.

Apparently the wrong grouping only introduced an inefficiency, not any bugs, so
the tests still passed.

13 years agoAdd Peter John Acklam to AUTHORS
Florian Ragwitz [Sun, 7 Nov 2010 15:21:58 +0000 (16:21 +0100)]
Add Peter John Acklam to AUTHORS

13 years agoRT ticket #61812: digit($n) with $n "out of range"
Peter John Acklam [Thu, 4 Nov 2010 17:08:56 +0000 (18:08 +0100)]
RT ticket #61812: digit($n) with $n "out of range"

The _digit($n) method in Math::BigInt::Calc should return 0 when $n
refers to a leading zero digit. E.g., the number '314' is just the
same as '000314', except that the leading zeros omitted, so _digit($n)
should return '0' when $n refers to a leading zero digit.

- lib/Math/BigInt/Calc.pm: Improve comments in source code. Add code
  returning zero when input refers to a leading zero digit. Removed
  redundant zero padding in temporary string argument to substr().

- t/bigintc.t: Add four test cases verifying the behaviour. Increment
  number of test by four.

13 years agoRT ticket #62643: typos in POD and code comments
Peter John Acklam [Thu, 4 Nov 2010 18:12:49 +0000 (19:12 +0100)]
RT ticket #62643: typos in POD and code comments

Fix lots of typos and spelling errors in the documentation (POD)
and the comments in the code, without changing any of the actual
(executed) code.

- BUGS: Fixed typos.

- CHANGES: Fixed typos.

- HISTORY: Fixed typos.

- TODO: Fixed typos.

- examples/bigprimes.pl: Fixed typos.

- lib/Math/BigFloat.pm: Fixed typos.

- lib/Math/BigInt/Calc.pm: Fixed typos.

- lib/Math/BigInt.pm: Fixed typos.

- t/bigintpm.inc: Fixed typos.

- t/inf_nan.t: Fixed typos.

- t/mbimbf.inc: Fixed typos.

- t/mbimbf.t: Fixed typos.

13 years agoRT ticket #62101: as_int() returns NaN for inf
Peter John Acklam [Fri, 5 Nov 2010 10:52:14 +0000 (11:52 +0100)]
RT ticket #62101: as_int() returns NaN for inf

Math::BigFloat -> binf() -> as_int() returns NaN, but should return
inf. In other words, if $x is a Math::BigFloat, then $x -> as_int()
shall return the same as Math::BigInt -> new($x). The bug appears both
for +inf and -inf.

-lib/Math/BigFloat.pm: Add two lines to catch the cases when the input
 is +/-inf and NaN, respectively.

-t/bare_mbf.t: incremented test count by 3

-t/bigfltpm.inc: add 3 tests, for +inf, -inf, and NaN

-t/bigfltpm.t: incremented test count by 3

-t/sub_mbf.t: incremented test count by 3

-t/with_sub.t: incremented test count by 3

13 years agoRT ticket #61845: from_bin() documentation error
Peter John Acklam [Thu, 4 Nov 2010 17:32:20 +0000 (18:32 +0100)]
RT ticket #61845: from_bin() documentation error

The documentation (POD) for the from_bin() method has a small error.
Binary numbers are prefixed by '0b', not '0x'.

- lib/Math/BigInt.pm: Fix documentation (POD) error.

13 years agoStructure dist/Math-BigInt-FastCalc like the CPAN dist
Florian Ragwitz [Sun, 7 Nov 2010 14:59:24 +0000 (15:59 +0100)]
Structure dist/Math-BigInt-FastCalc like the CPAN dist

This makes applying patches between them easier.

13 years agoUpdate Unicode-Collate to CPAN version 0.66
Chris 'BinGOs' Williams [Sun, 7 Nov 2010 13:31:59 +0000 (13:31 +0000)]
Update Unicode-Collate to CPAN version 0.66

  [DELTA]

  0.66  Sun Nov  7 10:47:30 2010
    - U::C::Locale newly supports locale: ko.
    - added Unicode::Collate::CJK::Korean for ko.
    - added t/loc_ko.t.
    - 12 compat. ideographs (e.g. U+FA0E) are treated as unified ideographs.
     (though DUCET also does it, now Unicode::Collate does it without DUCET.)
    - added t/compatui.t.
    ! Ideographs Ext.B (U+20000..U+2A6D6) can be overrided with UCA_Version 8.
      This is a long-standing behavior from Unicode::Collate 0.11 to 0.63.
      A wrong fix at 0.64 should be abandoned.

13 years agoSynchronise Math::BigInt{,::FastCalc} with CPAN
Florian Ragwitz [Sun, 7 Nov 2010 11:21:04 +0000 (12:21 +0100)]
Synchronise Math::BigInt{,::FastCalc} with CPAN

13 years agoUpdate File-Fetch to CPAN version 0.26
Chris 'BinGOs' Williams [Sun, 7 Nov 2010 11:19:44 +0000 (11:19 +0000)]
Update File-Fetch to CPAN version 0.26

  [DELTA]

  Changes for 0.26        Sat Nov  6 23:30:59 2010
  =================================================
  * Added support for HTTP::Lite
  * Resolved issue with '-l' switch and iosock fetch

13 years agoFix a compiler warning
Florian Ragwitz [Sat, 6 Nov 2010 20:33:51 +0000 (21:33 +0100)]
Fix a compiler warning

gcc said:
  regexec.c: In function ‘S_reginclass’:
  regexec.c:6305: warning: suggest parentheses around ‘&&’ within ‘||’

13 years agolocalize $@ during binmode (RT#78844)
David Golden [Sat, 6 Nov 2010 20:00:18 +0000 (16:00 -0400)]
localize $@ during binmode (RT#78844)

13 years agoAdd Nicolas Kaiser to AUTHORS.
Craig A. Berry [Sat, 6 Nov 2010 19:13:11 +0000 (14:13 -0500)]
Add Nicolas Kaiser to AUTHORS.

13 years agoRT 78836: vms/vms.c: dubious expressions
Nicolas Kaiser [Sat, 6 Nov 2010 16:54:52 +0000 (11:54 -0500)]
RT 78836: vms/vms.c: dubious expressions

I noticed two dubious expressions that look as if they were
intended to be assignments. The comment above the code says
it's broken.

13 years agoAdd new ops in Opcode, so it does not warn at compilation
Rafael Garcia-Suarez [Sat, 6 Nov 2010 15:06:34 +0000 (16:06 +0100)]
Add new ops in Opcode, so it does not warn at compilation

The ops are the recently-introduced reach, rvalues, rkeys and transr.

13 years agoG_VOID, G_SCALAR, and G_ARRAY are not separate bits anymore
Niko Tyni [Sat, 6 Nov 2010 13:18:15 +0000 (06:18 -0700)]
G_VOID, G_SCALAR, and G_ARRAY are not separate bits anymore

Commit 2f8edad0d37e91319b6ba10b3745327ea49c179 made G_ARRAY
equal to G_SCALAR | G_VOID, contrary to perlcall.pod.

Bring the documentation up to date and add a test to prevent a similar
(although unlikely) accident in the future.

13 years agoAdded test for RT#78844
David Golden [Sat, 6 Nov 2010 11:54:03 +0000 (07:54 -0400)]
Added test for RT#78844

13 years agoEliminate a few more $op->private calls in Deparse
Father Chrysostomos [Sat, 6 Nov 2010 07:06:51 +0000 (00:06 -0700)]
Eliminate a few more $op->private calls in Deparse

13 years agoMake Deparse work with y/å/ø/
Father Chrysostomos [Sat, 6 Nov 2010 07:05:36 +0000 (00:05 -0700)]
Make Deparse work with y/å/ø/

13 years agoTest y///r with B::Deparse
Father Chrysostomos [Sat, 6 Nov 2010 07:00:01 +0000 (00:00 -0700)]
Test y///r with B::Deparse

13 years agoAvoid a run-time miniperl check every time SWASHNEW is called
Father Chrysostomos [Sat, 6 Nov 2010 06:51:06 +0000 (23:51 -0700)]
Avoid a run-time miniperl check every time SWASHNEW is called

13 years agoRemove details that changed over seven years ago.
Tom Hukins [Fri, 14 May 2010 15:06:42 +0000 (15:06 +0000)]
Remove details that changed over seven years ago.

FreeBSD 5.0 was released on 2003-01-17 so everyone should be used to
FreeBSD lacking Perl in its base system by now.

13 years agoClarify wording.
Tom Hukins [Thu, 13 May 2010 13:14:31 +0000 (13:14 +0000)]
Clarify wording.

13 years agoRefer to other documents more specifically
Tom Hukins [Tue, 11 May 2010 14:07:28 +0000 (14:07 +0000)]
Refer to other documents more specifically

13 years agoLink to perlbug's POD
Tom Hukins [Fri, 12 Mar 2010 17:27:31 +0000 (17:27 +0000)]
Link to perlbug's POD

13 years agoutf8_heavy.pl: Make callable during Perl's compilation
Karl Williamson [Thu, 4 Nov 2010 21:02:17 +0000 (15:02 -0600)]
utf8_heavy.pl: Make callable during Perl's compilation

It's possible for this to be called during the compilation phase of Perl
by miniperl before the Unicode tables have been built.  This patch
checks if dynamic loading is available, and if not evals the require
needed to gain access to the tables.  If it succeeds, the tables have
been built; if it doesn't, instead of dying, just return empty tables,
as currently the things being built don't require information outside
the ASCII range, which is hard-coded into Perl without needing the
tables.

In the future, that may not be the case, and then likely the tables will
have to be shipped with Perl, and make regen would be done to rebuild
them.

13 years agoA hack for t/harness to restore the ability to run tests listed in @ARGV
Nicholas Clark [Fri, 5 Nov 2010 16:18:35 +0000 (16:18 +0000)]
A hack for t/harness to restore the ability to run tests listed in @ARGV

13 years agoTweak the test from 98517ccb8d5e8751 to work with PERL_UNICODE set.
Nicholas Clark [Fri, 5 Nov 2010 16:15:18 +0000 (16:15 +0000)]
Tweak the test from 98517ccb8d5e8751 to work with PERL_UNICODE set.

One should always generate the golden B::Concise output with PERL_UNICODE set
so that ${^OPEN} is set, as the test system knows how to take it out, not put
it in.

13 years agoDocument that the -Ci, -Co, and -CD options have file scope
Niko Tyni [Fri, 5 Nov 2010 11:59:14 +0000 (13:59 +0200)]
Document that the -Ci, -Co, and -CD options have file scope

While the other -C settings are global, "i" and "o" only affect subsequent
open() calls in the current file. Document this and add two tests to
make sure the documented behaviour doesn't change accidentally.

13 years agoAvoid creating lots of mortals in B::walkoptree()
Nicholas Clark [Fri, 5 Nov 2010 13:51:46 +0000 (13:51 +0000)]
Avoid creating lots of mortals in B::walkoptree()

When calling out to the user-supplied method, re-use the same reference and
object where possible. Only create a new one if the user supplied method
modified the reference or object passed to it.

The previous implementation had a comment "Use the same opsv. Rely on methods
not to mess it up." but it was actually generating a new reference for every
call, and also a new object for every recursive call. So massive churn of
objects, and large accumulation of mortals on the temp stack.

13 years agoB::Concise was failing to traverse some children of PMOPs
Nicholas Clark [Fri, 5 Nov 2010 11:28:12 +0000 (11:28 +0000)]
B::Concise was failing to traverse some children of PMOPs

Notably the substcont of s/// was being missed.

The bug was introduced as part of c0939ceec1b3e902,
"Re: [patch] teach B::Concise to see XS code", which did rather more than it
said on the tin.

13 years agoStop B from crashing on y/å/ø/
Father Chrysostomos [Thu, 4 Nov 2010 17:08:27 +0000 (10:08 -0700)]
Stop B from crashing on y/å/ø/

13 years agoRT 78818 Sync the description of \E in perlop with perlre
brian d foy [Thu, 4 Nov 2010 18:05:06 +0000 (13:05 -0500)]
RT 78818 Sync the description of \E in perlop with perlre

Posted by Niko Tyni

Commit 9bb1f947 fixed the description of \E in perlre.pod to include
the 'end quoted section' functionality, so update the similar list in
perlop.pod too.

Triggered by http://bugs.debian.org/126238

13 years agoRT 78814 perlfunc/open(): four items are not a triple
brian d foy [Thu, 4 Nov 2010 17:59:50 +0000 (12:59 -0500)]
RT 78814 perlfunc/open(): four items are not a triple

Reported by Niko Tyni

Commit b76cc8ba45957 made each group a quadruple without
updating the name. Take out the name altogether to avoid
this in the future.

Also update the reference to "list form" pipes to include
both the old last example and the new one.

Originally noticed by Reuben Thomas in http://bugs.debian.org/469402

13 years agoSome tests for B::walkoptree.
Nicholas Clark [Thu, 4 Nov 2010 15:32:26 +0000 (15:32 +0000)]
Some tests for B::walkoptree.

Quite likely coverage isn't that good, but some tests are better than none.
More tests welcome.

13 years agoCreate &B::{IV,PV}::as_string using typeglob assignment rather than goto &
Nicholas Clark [Thu, 4 Nov 2010 14:21:05 +0000 (14:21 +0000)]
Create &B::{IV,PV}::as_string using typeglob assignment rather than goto &

Typeglob assignment avoids compiler work creating the optree for a second
subroutine, and runtime work executing that optree.

13 years agoExclude more exported but non-existent functions.
Craig A. Berry [Thu, 4 Nov 2010 12:36:52 +0000 (07:36 -0500)]
Exclude more exported but non-existent functions.

pp_reach, pp_rvalues, and pp_transr are aliases, but regen/opcode.pl
generates declarations for aliases as if they were C functions in
their own right.  This is necessary for aliases that refer to mathoms
(as most of them do) but seems less right for new entries that will
never refer to an actual function of the same name.  For now, these
need to be explicitly excluded when building the linker options file
on VMS.  Failure to do so breaks the build with undefined symbol
warnings.

13 years agoUpdate version of Safe in Maintainers.pl to match recent version change
Chris 'BinGOs' Williams [Thu, 4 Nov 2010 12:30:43 +0000 (12:30 +0000)]
Update version of Safe in Maintainers.pl to match recent version change

13 years agoAvoid needing to stub B::OPf_KIDS by loading the XS earlier.
Nicholas Clark [Thu, 4 Nov 2010 11:39:19 +0000 (11:39 +0000)]
Avoid needing to stub B::OPf_KIDS by loading the XS earlier.

This will also inline the constant in the code of walkoptree_slow().
Things are complicated by the fact that B's BOOT code needs $VERSION set, and
pushes to @EXPORT_OK.

Move the 'use strict' much earlier.

13 years agoRemove two use of dXSI32; superfluous because xsubpp automatically adds it.
Nicholas Clark [Thu, 4 Nov 2010 09:42:52 +0000 (09:42 +0000)]
Remove two use of dXSI32; superfluous because xsubpp automatically adds it.

13 years agoAdd Marty Pauley’s other e-mail address to checkAUTHORS.pl
Father Chrysostomos [Thu, 4 Nov 2010 07:33:24 +0000 (00:33 -0700)]
Add Marty Pauley’s other e-mail address to checkAUTHORS.pl

13 years agofix for #23790.
Marty Pauley [Sun, 24 Oct 2010 09:02:40 +0000 (18:02 +0900)]
fix for #23790.

padav is leaving an arrayref on the stack when producing the return value for an
lvalue sub.  But when this is in an argument list it really should be a array,
not a ref.  So, in leavesublv I check for this case and expand the arrayref to
an array.

13 years agoInline tryAMAGICunDEREF_var() into its callers and eliminate it.
Nicholas Clark [Wed, 3 Nov 2010 16:54:05 +0000 (16:54 +0000)]
Inline tryAMAGICunDEREF_var() into its callers and eliminate it.

Nothing outside the core was using this macro.

13 years agoAdd Perl_amagic_deref_call() to implement the bulk of tryAMAGICunDEREF_var().
Nicholas Clark [Wed, 3 Nov 2010 14:57:11 +0000 (14:57 +0000)]
Add Perl_amagic_deref_call() to implement the bulk of tryAMAGICunDEREF_var().

This removes around 300 bytes of object code from each place it was previously
inlined. It also provides a better interface - quite a lot of the core
currently bodges things by creating a local variable C<SV **sp = &sv> to use
the macro.

Change the XS::APItest wrapper to amagic_deref_call().

13 years agoAdd tests for tryAMAGICunDEREF_var().
Nicholas Clark [Wed, 3 Nov 2010 12:07:51 +0000 (12:07 +0000)]
Add tests for tryAMAGICunDEREF_var().

13 years agoUpdate Unicode-Collate to CPAN version 0.65
Chris 'BinGOs' Williams [Wed, 3 Nov 2010 11:21:11 +0000 (11:21 +0000)]
Update Unicode-Collate to CPAN version 0.65

  [DELTA]

  0.65  Wed Nov  3 13:10:20 2010
    - U::C::Locale newly supports locale: zh and its some variants.
             (zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke)
    - added Unicode::Collate::CJK::Big5   for zh__big5han.
    - added Unicode::Collate::CJK::GB2312 for zh__gb2312han.
    - added Unicode::Collate::CJK::Pinyin for zh__pinyin.
    - added Unicode::Collate::CJK::Stroke for zh__stroke.

13 years agofix 68564: /g failure with zero-width patterns
Yves Orton [Wed, 3 Nov 2010 09:23:00 +0000 (10:23 +0100)]
fix 68564: /g failure with zero-width patterns

This is based on a patch by Father Chrysostomos <sprout@cpan.org>

The start class optimisation has two modes, "try every valid start
position" (doevery) and "flip flop mode" (!doevery) where it trys
only the first valid start position in a sequence.

Consider /(\d+)X/ and the string "123456Y", now we know that if we fail
to match X after matching "123456" then we will also fail to match after
"23456" (assuming no evil tricks are in place, which disable the
optimisation anyway), so we know we can skip forward until the check
/fails/ and only then start looking for a real match. This is flip-flop
mode.

Now consider the case with zero-width lookahead under /g: /(?=(\d+)X)/.
In this case we have an additional failure mode, that is failure when
we match a zero-width string twice at the same pos(). So now, the
"flip-flop" logic breaks as it /is/ possible that we could match at
"23456" when we couldn't match at "123456" because of the zero-length
twice at the same pos() rule. For instance:

  print $1 for "123"=~/(?=(\d+))/g

should first match "123". Since $& is zero length, pos() is not
incremented. We then match again, successfully, except that the match
is rejected despite technical-success because its $& is also zero
length and pos() has not advanced. If the flip-flop mode is enabled
we wont retry until we find a failing character first.

The point here is that it makes perfect sense to disable the
"flip-flop" mode optimisation when the start class is inside
a lookahead as it really doesnt apply.

13 years agoclarify code and intent of code in a comment
Yves Orton [Tue, 2 Nov 2010 13:26:46 +0000 (14:26 +0100)]
clarify code and intent of code in a comment

13 years agofix incorrect comment
Yves Orton [Tue, 2 Nov 2010 13:26:25 +0000 (14:26 +0100)]
fix incorrect comment

13 years agofix the trie part of rt-78356
Yves Orton [Tue, 2 Nov 2010 13:24:20 +0000 (14:24 +0100)]
fix the trie part of rt-78356

When the jump code was added the case of an empty string followed
by a jump wasnt accounted for. One could argue it should not happen
however that is a matter for a different commit.

13 years agoDocument y///r
Father Chrysostomos [Wed, 3 Nov 2010 04:32:05 +0000 (21:32 -0700)]
Document y///r

13 years agoDocument the ‘Using !~’ errors
Father Chrysostomos [Wed, 3 Nov 2010 03:28:51 +0000 (20:28 -0700)]
Document the ‘Using !~’ errors

13 years agoIncrease B::Concise’s version
Father Chrysostomos [Wed, 3 Nov 2010 03:13:59 +0000 (20:13 -0700)]
Increase B::Concise’s version

13 years agoy///r
Father Chrysostomos [Wed, 3 Nov 2010 03:19:25 +0000 (20:19 -0700)]
y///r

13 years agos///r leaks like a sieve
Father Chrysostomos [Wed, 3 Nov 2010 03:06:08 +0000 (20:06 -0700)]
s///r leaks like a sieve

13 years agoDon’t capitalise words in the middle of an error message
Father Chrysostomos [Tue, 2 Nov 2010 15:38:57 +0000 (08:38 -0700)]
Don’t capitalise words in the middle of an error message

13 years agoAdd transr op type
Father Chrysostomos [Wed, 3 Nov 2010 03:18:15 +0000 (20:18 -0700)]
Add transr op type

for the upcoming y///r feature. There are not enough flag bits,
hence the extra type.

13 years agoAvoid multiple $op->private calls in B::Deaprse::pp_trans
Father Chrysostomos [Tue, 2 Nov 2010 12:53:56 +0000 (05:53 -0700)]
Avoid multiple $op->private calls in B::Deaprse::pp_trans

13 years agoInline RvDEEPCP() into its only caller, Perl_amagic_call().
Nicholas Clark [Tue, 2 Nov 2010 20:06:50 +0000 (20:06 +0000)]
Inline RvDEEPCP() into its only caller, Perl_amagic_call().

Only Perl_amagic_call() was using RvDEEPCP() when it was added in 5.000, and I
believe that it's never had any other users (in the core, on CPAN, or anywhere
else visible to Google codesearch). Hence it seems an ideal candidates to be
inlined and eliminated.

13 years agoImplement the loop in tryAMAGICunDEREF_var() using while, rather than goto.
Nicholas Clark [Tue, 2 Nov 2010 16:40:39 +0000 (16:40 +0000)]
Implement the loop in tryAMAGICunDEREF_var() using while, rather than goto.

Yes, it was a while loop implemented using goto, although this only became
clear by untangling the macros. I believe it need never have been implemented
as goto, given that the other user of tryAMAGICunW_var "broke" out of the
"if"'s block using a return, hence that "if" could have been a "while" all
along.

13 years agoExpand AMG_CALLun_var() into all its users, and eliminate it.
Nicholas Clark [Tue, 2 Nov 2010 15:38:31 +0000 (15:38 +0000)]
Expand AMG_CALLun_var() into all its users, and eliminate it.

Aside from the 2 callers where it can be replaced with AMG_CALLun().
AMG_CALLun_var was only used in core.

13 years agoInline tryAMAGICunW_var() into macros tryAMAGICun{DEREF_var,TARGET}
Nicholas Clark [Tue, 2 Nov 2010 14:52:37 +0000 (14:52 +0000)]
Inline tryAMAGICunW_var() into macros tryAMAGICun{DEREF_var,TARGET}

This also inlines and eliminates FORCE_SETs and setAGAIN.

The three eliminated macros were not referenced from anywhere else. (The core,
CPAN, code visible to Google codesearch.)