This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoFix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATE
Nicholas Clark [Wed, 26 Jun 2013 16:01:09 +0000 (18:01 +0200)]
Fix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATE

With PERL_GLOBAL_STRUCT_PRIVATE "global" variables are in a structure in
malloc()ed memory, not in global static variables or a global static
structure. Hence no global variables are implicitly initialised to zero.

* PL_curinterp and PL_op_sequence need initialising to NULL
* The global structure is free()d before handlers registered with atexit()
  run, so be defensive about this.
* Some C code checks SvOK(PL_sv_placeholder) so ensure that its SvFLAGS()
  are 0.
* Zero PL_hash_seed

10 years agoSpecify the versions of ExtUtils::MiniPerl and ExtUtils::Embed needed.
Nicholas Clark [Thu, 11 Jul 2013 11:51:31 +0000 (13:51 +0200)]
Specify the versions of ExtUtils::MiniPerl and ExtUtils::Embed needed.

Without this, regen/miniperlmain.pl could end up finding versions which are
out of date, and silently generate an incorrect miniperlmain.c

10 years agoInline the Makefile target perl.valgrind.config into its only remaining user.
Nicholas Clark [Thu, 11 Jul 2013 09:33:41 +0000 (11:33 +0200)]
Inline the Makefile target perl.valgrind.config into its only remaining user.

Add the 3 recently deleted Makefile targets to the list in perldelta.pod, and
reflow the list.

10 years agoEliminate the Makefile targets test_notty.valgrind and test_prep.valgrind.
Nicholas Clark [Thu, 11 Jul 2013 09:00:54 +0000 (11:00 +0200)]
Eliminate the Makefile targets test_notty.valgrind and test_prep.valgrind.

The target test_notty.valgrind depends on the target test_prep.valgrind.
The target test_prep.valgrind depends on the target perl.valgrind.
The target perl.valgrind does not exist!

perl.valgrind never existed. The targets which depend on it were added as
part of commit 7a834142adbc51cc (Aug 2003), which added code and
documentation for running the test suite with valgrind. However, that commit
did not add a perl.valgrind target, despite adding dependencies on it. Hence
the various targets which depended on it could never have worked. Of the
4 similar targets, only test.valgrind works because unlike the other 3,
it depends on test_prep, not test_prep.valgrind

10 years agoswitchd.t: correct bug number
Father Chrysostomos [Fri, 12 Jul 2013 05:01:39 +0000 (22:01 -0700)]
switchd.t: correct bug number

10 years agoConsistent spaces after dots in perlvar
Father Chrysostomos [Thu, 11 Jul 2013 19:40:03 +0000 (12:40 -0700)]
Consistent spaces after dots in perlvar

10 years ago[perl #118627] Don’t do COW when creating ${"_<-e"}[0]
Father Chrysostomos [Thu, 11 Jul 2013 20:13:58 +0000 (13:13 -0700)]
[perl #118627] Don’t do COW when creating ${"_<-e"}[0]

The lexer does not expect PL_linestr (an SV holding the current line
of Perl code being parsed) to do copy-on-write.  It expects to be able
to manipulate that SV to its hearts content with impunity.  The one
piece of code that can cause it to do that is S_update_debugger_info,
when called with a SV for the first argument.  The only time it is
called that way is for line 0 of the main script, containing state-
ments generated from command line arguments (e.g., ‘use strict’ from
‘-Mstrict’), and it is called with PL_linestr as its argument.

If ${"_<-e"}[0] ends up sharing the buffer with PL_linestr, bad things
will happen, as the lexer is going to continue to modify that buffer.

Usually we get this:

$ ./perl -It/lib -d:switchd_empty -e'print @{"_<-e"}' |less
^@se Devel::switchd_empty;
print @{"_<-e"}

So force S_update_debugger_info to do a non-COW copy.

10 years agoRefactor perlmodlib.PL to use regen_lib.pl and avoid FindBin.
Nicholas Clark [Wed, 10 Jul 2013 11:59:57 +0000 (13:59 +0200)]
Refactor perlmodlib.PL to use regen_lib.pl and avoid FindBin.

Instead of using FindBin, pass a directory to use on the command line.
Use regen_lib for handling the output file.
die if any file opened for reading has errors on closing.
Run with the cwd as the top level of the distribution, instead of pod/

10 years agoSplit the handling for "Illegal character" and "Illegal character after '_'"
Peter Martini [Tue, 25 Jun 2013 08:47:56 +0000 (04:47 -0400)]
Split the handling for "Illegal character" and "Illegal character after '_'"

After applying this patch, both can now be triggered at once, whereas
previously any use of '_' would trigger the "after '_'" variant.  Since
the two warnings warn for different reasons, there's no reason to
conflate the two.  Also updated perldiag with a clearer explanation
of the tighter restrictions after an underscore.

(In the tests, the change of uniproto12 to uniproto13 is merely correcting
an error from a previous patch, reusing the name would conflate
two kinds of tests in one statement).

10 years agoperldelta: document locale changes
Karl Williamson [Thu, 11 Jul 2013 02:26:39 +0000 (20:26 -0600)]
perldelta: document locale changes

10 years agoperldelta for 2c179de53ae082
Tony Cook [Thu, 11 Jul 2013 01:23:49 +0000 (11:23 +1000)]
perldelta for 2c179de53ae082

10 years ago[perl #118829] Memory leaks in STORABLE_attach
Vladimir Timofeev [Thu, 11 Jul 2013 01:05:44 +0000 (11:05 +1000)]
[perl #118829] Memory leaks in STORABLE_attach

10 years agoFix typo in docs for SvPV: ") => >"
Brian Gottreu [Wed, 10 Jul 2013 13:14:35 +0000 (08:14 -0500)]
Fix typo in docs for SvPV: ") => >"

10 years agoUpdate comment in autodoc.pl - it's not run from regen.pl
Nicholas Clark [Wed, 10 Jul 2013 13:34:00 +0000 (15:34 +0200)]
Update comment in autodoc.pl - it's not run from regen.pl

This should have been done as part of commit 22b7b87b206c3e0c.

10 years agoConvert to use of Test::More. Boost test coverage.
James E Keenan [Tue, 9 Jul 2013 15:54:44 +0000 (17:54 +0200)]
Convert to use of Test::More. Boost test coverage.

Since File::Compare's functions are documented to return 1, 0, or -1, we will
continue to examine the return value in our tests, rather than simply checking
for truth when 0 or 1 is returned.

Following code review, eliminate trailing whitespace.

For: RT #118823

10 years ago'Prototype after' and 'Illegal character' warnings should both pretty print the proto...
Peter Martini [Tue, 9 Jul 2013 04:29:48 +0000 (00:29 -0400)]
'Prototype after' and 'Illegal character' warnings should both pretty print the prototype text.

For example, prior to this patch,
eval "sub foo (@\0) {}"
would give two warnings:

Prototype after '@' for main::foo : @ at (eval 1) line 1.
Illegal character in prototype for main::foo : @\0 at (eval 1) line 1.

In both cases, the representation which makes a NULL visible
is useful, and of course since we're printing the same warning twice,
it doesn't hurt to display it consistently.

10 years agoSuppress system Term::ReadLine::Gnu
Petr Písař [Mon, 8 Jul 2013 14:10:38 +0000 (16:10 +0200)]
Suppress system Term::ReadLine::Gnu

perl5db.t will die in Term::ReadLine if Term::ReadLine::Gnu is installed
in the system. Let's favour core implementation.

Best solution would be to prune @INC to prevent from loading already
installed modules like this:

BEGIN {
    use Config;
    @INC = grep { ! /^\Q$Config{installprefix}\E(\/|\z)/ } @INC;
}

However that is not possible (now) due to various execs (even without
proper -I) in the harness chain. perl should implement -nostdinc
option.

Signed-off-by: Petr Písař <ppisar@redhat.com>
10 years agoAdd Nathan Trapuzzano to AUTHORS
Father Chrysostomos [Wed, 10 Jul 2013 03:39:00 +0000 (20:39 -0700)]
Add Nathan Trapuzzano to AUTHORS

10 years agoFix typo in perlreapi(1perl).
Nathan Trapuzzano [Wed, 10 Jul 2013 00:59:34 +0000 (20:59 -0400)]
Fix typo in perlreapi(1perl).

10 years agoQuiet warning in a DEBUG print
Peter Martini [Wed, 10 Jul 2013 03:07:10 +0000 (23:07 -0400)]
Quiet warning in a DEBUG print

The variable type is STRLEN, and the format
code is expecting a UV, so just cast it to UV
to quiet a warning.

10 years agolocale documentation: Grammaar and appearance nits
Karl Williamson [Wed, 10 Jul 2013 04:08:00 +0000 (22:08 -0600)]
locale documentation: Grammaar and appearance nits

10 years agoPATCH: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")
Karl Williamson [Mon, 8 Jul 2013 20:04:45 +0000 (14:04 -0600)]
PATCH: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")

This commit causes the locale initialization to skip calling
setlocal(foo, "") if the environment variable PERL_SKIP_LOCALE_INIT is
set.  Instead, the setup code calls setlocale(LC_ALL, NULL) (plus other
similar calls for the subcategories) in order to find out what the
current locale is.

The original poster for this ticket has a workaround for it which
involves using a modified copy of Perl core code.  This patch defines
the C preprocessor variable HAS_SKIP_LOCALE_INIT that can be used by XS
writers to discover if the current Perl version needs the workaround or
not.

I was unable to come up with a test for this patch that did not involve
building extensive infrastructure for testing embedded Perl.  That does
not seem worth it for such a trivial patch.  I tested by hand.

10 years agoMake method lookup treat *foo as \*foo
Father Chrysostomos [Tue, 9 Jul 2013 15:26:05 +0000 (08:26 -0700)]
Make method lookup treat *foo as \*foo

It is possible to call a method on a typeglob with an IO thingy, as in
*ARGV->getline.  This treats the invocant as a handle and looks up its
methods in IO::File.

As of commit 7156e69, a typeglob without an IO thingy is treated
as a class:

$ ./perl -Ilib -e 'sub foo::oof { print "foof!\n" } *foo->oof'
foof!

It did not occur to me back then that globs were being stringified in
method lookup.

Before that commit, names beginning with a non-alphabetic character
were permitted for handle names, but not for package names.  That
fact, and the fact that symbol lookup in general will ignore an ini-
tial * followed by a letter, allowed *ARGV->getline to work.

For *Package->foo to work was a mistake.

It turns out, also, that the glob stringification could cause the
wrong handle to be used, e.g., after glob aliasing.  Also, a handle
whose stringification begins with * followed by a non-alphabetic char-
acter will not work, because symbol lookup does not strip * from the
stringified glob:

$ ./perl -Ilib -e '$::Foo::VERSION; package Foo; open FH, "perl"; *FH->getline'
Can't locate object method "getline" via package "*::Foo::FH" (perhaps you forgot to load "*::Foo::FH"?) at -e line 1.

This commit fixes all this inconsistency by simply not stringifying
the glob.  *FH->foo is now treated the same way as (\*FH)->foo (as it
already was in those cases where it worked).

This does allow PVLV globs to reach code that they couldn’t reach
before, so this patch has to handle those, too.  (newRV probably ought
to handle PVLVs, but it currently doesn’t.)

10 years agoBetter document setlocale, "use locale" interactions
Karl Williamson [Wed, 10 Jul 2013 00:27:45 +0000 (18:27 -0600)]
Better document setlocale, "use locale" interactions

The POSIX::setlocale() documentation failed to mention that "use locale"
is also usually necessary.

10 years agoUpdate Getopt-Long to CPAN version 2.41
Chris 'BinGOs' Williams [Tue, 9 Jul 2013 19:39:11 +0000 (20:39 +0100)]
Update Getopt-Long to CPAN version 2.41

  [DELTA]

Changes in version 2.41
-----------------------

* Change INSTALLDIRS to site for perl >= 5.011.

  See https://rt.perl.org/rt3//Ticket/Display.html?id=116479
  for details.

10 years agomethod.t: Correct miniperl skip count
Father Chrysostomos [Tue, 9 Jul 2013 13:15:04 +0000 (06:15 -0700)]
method.t: Correct miniperl skip count

210fdecd missed this.

10 years agoadd entries to various .gitignore files for Win32 builds
Daniel Dragan [Sat, 6 Jul 2013 03:19:57 +0000 (23:19 -0400)]
add entries to various .gitignore files for Win32 builds

win32/html and cpan/Module-Build/t/install_test* generate dozens of
non-versioned files on a Win32 build which makes committing cumbersome

10 years agoMerge the refactoring of ExtUtils::Miniperl and ExtUtils::Embed.
Nicholas Clark [Tue, 9 Jul 2013 06:24:38 +0000 (08:24 +0200)]
Merge the refactoring of ExtUtils::Miniperl and ExtUtils::Embed.

10 years agoDescribe the changes to ExtUtils::{Embed,Miniperl} in perldelta.
Nicholas Clark [Mon, 8 Jul 2013 15:23:52 +0000 (17:23 +0200)]
Describe the changes to ExtUtils::{Embed,Miniperl} in perldelta.

10 years agoChange the *nix and VMS Makefiles to to pass a filename to writemain().
Nicholas Clark [Mon, 8 Jul 2013 15:00:35 +0000 (17:00 +0200)]
Change the *nix and VMS Makefiles to to pass a filename to writemain().

Adding a first argument as a reference to the filename "perlmain.c" makes
ExtUtils::Miniperl::writemain() open and close the file for us. This is
safer than having the Makefile create the file using output redirection as
that can create an empty file if compilation aborts. This change means that
the file is only moved into place with the correct name if it has been
written completely without error. If an error happens the file is not
created, the make aborts, and any subsequent make will re-attempt to create
the file, instead of continuing with an incorrect file, hiding the real
cause of the problems.

10 years agoExtUtils::Miniperl::writemain()'s first argument can also be a filename.
Nicholas Clark [Mon, 8 Jul 2013 14:41:30 +0000 (16:41 +0200)]
ExtUtils::Miniperl::writemain()'s first argument can also be a filename.

Treat a reference to a scalar as the name of a file to open for output.
Any other reference is used as an output filehandle.
Otherwise the default remains to write to STDOUT.

10 years agoUse more semantic markup in the Pod for ExtUtils::Embed.
Nicholas Clark [Mon, 8 Jul 2013 13:23:48 +0000 (15:23 +0200)]
Use more semantic markup in the Pod for ExtUtils::Embed.

Instead of B<> use F<> for filenames.
Instead of B<> use C<> for code.
Instead of B<> use I<> for parameter names.
Instead of F<> use C<> for e-mail addresses.

Remove semantically unnecessary blank lines, and trailing spaces from edited
lines.

10 years agoRefactor ExtUtils::Embed::xsi_{protos,body} to use a scalar $retval.
Nicholas Clark [Mon, 8 Jul 2013 13:12:28 +0000 (15:12 +0200)]
Refactor ExtUtils::Embed::xsi_{protos,body} to use a scalar $retval.

Previously the code was accumulating the return value by pushing lines
onto an array @retval, then joining it to a single scalar on return.
As nothing needs the individual lines, reduce the complexity by concatenating
directly to a scalar.

10 years agoRefactor xsinit generation code in ExtUtils::Embed.
Nicholas Clark [Mon, 8 Jul 2013 10:11:35 +0000 (12:11 +0200)]
Refactor xsinit generation code in ExtUtils::Embed.

Remove tautological comments about loading modules.
Simplify xsi_protos() and static_ext().
canon('/','DynaLoader') is just 'DynaLoader' so inline the constant.
Refactor canon() to consistently use 1 regex pattern delimiter, avoid map
in void context, and teach it that extensions can be in 'dist' and 'cpan' as
well as 'ext'.
Remove obsolete C<require 5.002> statement.

10 years agoRefactor ExtUtils::Miniperl to use ExtUtils::Embed.
Nicholas Clark [Mon, 8 Jul 2013 09:21:15 +0000 (11:21 +0200)]
Refactor ExtUtils::Miniperl to use ExtUtils::Embed.

There is now only one copy of Perl code to generate the C for an xsinit()
function.

This also eliminates ExtUtils::Miniperl::canon(), which was not exported, and
is no longer needed.

10 years agoTweak ExtUtils::Embed's generated C code to be closer to ExtUtils::Miniperl.
Nicholas Clark [Mon, 8 Jul 2013 09:08:12 +0000 (11:08 +0200)]
Tweak ExtUtils::Embed's generated C code to be closer to ExtUtils::Miniperl.

Use #include "..." instead of #include <...> in xsi_header(), and don't add
a trailing newline (and add a newline in xsinit() to compensate).
Use four spaces instead of a tab for indenting.
If there are no extensions and hence no calls to newXS() don't declare file[]
and don't add a trailing newline.

10 years agoPropagate bugfixes from {mini,}perlmain.c into ExtUtils::Embed.
Nicholas Clark [Mon, 8 Jul 2013 08:39:50 +0000 (10:39 +0200)]
Propagate bugfixes from {mini,}perlmain.c into ExtUtils::Embed.

xs_init() must pass a static char* when creating &DynaLoader::boot_DynaLoader
(commit 1b77350017006d9e)

Avoid linker errors on Win32 by including perlapi.h (via XSUB.h)
(commit 3ecadf9633330795)

my_perl might be unused
(commit 96a5add60f1f39d3)

10 years agoRefactor ExtUtils::Embed to work with miniperl.
Nicholas Clark [Sun, 7 Jul 2013 13:12:42 +0000 (15:12 +0200)]
Refactor ExtUtils::Embed to work with miniperl.

Remove the use of FileHandle, which relies on IO, and XS module.
Only load Getopt::Std if it is needed (in xsinit()), to avoid needing to add
Getopt::Std to lib/buildcustomize.pl
Require File::Spec instead of using it, as it exports nothing, so there is no
benefit to using it (but it costs a BEGIN block).

10 years agoOn Win32 run autodoc.pl and pod/perlmodlib.PL using miniperl, not perl.
Nicholas Clark [Tue, 24 Apr 2012 20:48:38 +0000 (22:48 +0200)]
On Win32 run autodoc.pl and pod/perlmodlib.PL using miniperl, not perl.

*nix and VMS both use miniperl to run these two build scripts. This makes
Win32 consistent.

This eliminates the last two uses of the ICWD macro, so eliminate it too.

10 years ago[perl #116975] perlfunc require: fix example subroutine
David Golden [Tue, 9 Jul 2013 01:45:42 +0000 (11:45 +1000)]
[perl #116975] perlfunc require: fix example subroutine

10 years ago[perl #117033] wrong .packlist creation at installation on Cygwin with destdir
Tony Cook [Tue, 9 Jul 2013 00:37:32 +0000 (10:37 +1000)]
[perl #117033] wrong .packlist creation at installation on Cygwin with destdir

10 years agoperldelta template: consistent spaces after dots
Father Chrysostomos [Mon, 8 Jul 2013 20:52:30 +0000 (13:52 -0700)]
perldelta template: consistent spaces after dots

(pod2man or nroff [whichever] treats a dot at the end of a line
as a dot followed by two spaces.)

10 years agoperldelta: consistent spaces after dots
Father Chrysostomos [Mon, 8 Jul 2013 20:51:04 +0000 (13:51 -0700)]
perldelta: consistent spaces after dots

10 years ago[perl #113932] UNIVERSAL::can with globs and globrefs
Father Chrysostomos [Sun, 7 Jul 2013 19:31:00 +0000 (12:31 -0700)]
[perl #113932] UNIVERSAL::can with globs and globrefs

(Also perl #118105.)

This allows *ARGV->can("print") to work as long as IO::Handle is
loaded.  This translates into UNIVERSAL::can(\*ARGV,"print").  This
commit also changes UNIVERSAL::can to accept a plain *ARGV as well.

UNIVERSAL::can("ARGV",...) is left as it is (ARGV is treated as a pack-
age name), because changing that requires a bigger patch, and I don’t
know when I will get to it.

10 years agoperldelta for b2b69a966b47abd2cb4c320da60619b27c6c8abf
Chris 'BinGOs' Williams [Mon, 8 Jul 2013 19:46:08 +0000 (20:46 +0100)]
perldelta for b2b69a966b47abd2cb4c320da60619b27c6c8abf

10 years agoperldelta: Verbatim lines into 79 columns
Karl Williamson [Mon, 8 Jul 2013 19:00:39 +0000 (13:00 -0600)]
perldelta: Verbatim lines into 79 columns

10 years agoperllocale.pod: Fix misstatements, and some nits
Karl Williamson [Mon, 8 Jul 2013 18:48:28 +0000 (12:48 -0600)]
perllocale.pod: Fix misstatements, and some nits

"$!" (stringified) is always subject to the current locale, even outside
'use locale'.  The motiviation, I believe, for this is that these are
operating system messages that are generally of most value to the
end-user, and so should be expressed in terms that are understandable to
the end-user, regardless of what the Perl programmer did or didn't do.

10 years agoPATCH: [perl #115808]: POSIX::setlocale returns bizarre value on failure
Karl Williamson [Mon, 8 Jul 2013 04:42:43 +0000 (22:42 -0600)]
PATCH: [perl #115808]: POSIX::setlocale returns bizarre value on failure

It turns out that this bug is caused by a more general one, covered by
[perl #118693].  But in the meantime, this commit fixes the problem for
setlocale(), and makes the code slightly cleaner besides.

10 years agoperlexperiment: linux abstract domains sockets
Ricardo Signes [Mon, 8 Jul 2013 15:07:29 +0000 (11:07 -0400)]
perlexperiment: linux abstract domains sockets

...now they are upstream-cpan and supported

10 years agoperlexperiment: MLDBM is not part of core
Ricardo Signes [Mon, 8 Jul 2013 13:35:08 +0000 (09:35 -0400)]
perlexperiment: MLDBM is not part of core

10 years agoAdd block to exercise case of very large buffer in lib/File/Copy.pm.
James E Keenan [Fri, 5 Jul 2013 01:09:04 +0000 (03:09 +0200)]
Add block to exercise case of very large buffer in lib/File/Copy.pm.

10 years agoAdd tests for two previously unexercised sections of lib/Symbol.pm.
James E Keenan [Thu, 4 Jul 2013 13:33:40 +0000 (15:33 +0200)]
Add tests for two previously unexercised sections of lib/Symbol.pm.

10 years agoRemove trailing dots in t/porting/readme.t on VMS.
Craig A. Berry [Sun, 7 Jul 2013 19:28:21 +0000 (14:28 -0500)]
Remove trailing dots in t/porting/readme.t on VMS.

Because on VMS a zero-length extension still has a dot.

10 years agoRestore $(ARCHDIR)vmspipe.com to VMS build after 2d11a7e9678.
Craig A. Berry [Sun, 7 Jul 2013 19:03:33 +0000 (14:03 -0500)]
Restore $(ARCHDIR)vmspipe.com to VMS build after 2d11a7e9678.

That commit moved VMS::Filespec from vms/ext to ext/, but it also
deleted the vmspipe.com dependency from the LIBPREREQ target in
vms/descrip_mms.template.  (vmspipe.com has nothing to do with
VMS::Filespec.)  Which meant vmspipe.com was not availabe for
building extensions or running tests, and -- worse yet -- would
not get installed.  So every pipe creation would involve creating
a temporary version of this file using fallback code in vms/vms.c,
thus making the very pokey pipe implementation even more expensive.

10 years agoperl.c: Use Strerror instead of strerror
Karl Williamson [Thu, 20 Jun 2013 19:17:13 +0000 (13:17 -0600)]
perl.c: Use Strerror instead of strerror

The former works on more systems.

10 years agopp_sys.c: Use macro instead of reinventing it
Karl Williamson [Thu, 20 Jun 2013 19:13:40 +0000 (13:13 -0600)]
pp_sys.c: Use macro instead of reinventing it

The Strerror macro is defined properly to handle either case here.

10 years agoutil.c: Avoid unnecessary setlocale() calls
Karl Williamson [Thu, 20 Jun 2013 18:28:12 +0000 (12:28 -0600)]
util.c: Avoid unnecessary setlocale() calls

This code sets the locale to C around its work.  This is unnecessary if
the locale is already C, and there is an existing global that indicates
this, that can be tested to avoid the sets.

10 years agoPATCH: [perl #118197] Cope with non-ASCII decimal separators
Karl Williamson [Sat, 22 Jun 2013 18:49:01 +0000 (12:49 -0600)]
PATCH: [perl #118197] Cope with non-ASCII decimal separators

This patch causes the radix string to be examined upon a new numeric
locale being set.  If the string isn't ASCII, and the new locale is
UTF-8, it turns on the UTF-8 flag in the scalar that holds the radix.
When a floating point number is formatted in Perl_sv_vcatpvfn_flags(),
and the flag is on, the result's flag will be set on too.

10 years agoProperly determine if in locale for NV stringification
Karl Williamson [Fri, 28 Jun 2013 21:43:54 +0000 (15:43 -0600)]
Properly determine if in locale for NV stringification

Commit 68e8f474bc686a86c064b695b9c7400313d7af65 used the wrong macro to
determine if the operation is within the scope of 'use locale'.  It also
has to operate under 'use locale 'not_characters'.

Tests for this are coming in the patch for [perl #118197].

10 years agoUpdate DB_File to CPAN version 1.829
Chris 'BinGOs' Williams [Sun, 7 Jul 2013 18:42:27 +0000 (19:42 +0100)]
Update DB_File to CPAN version 1.829

  [DELTA]

  1.829 7 July 2013

   * make realclean: removing all files
     RT #68214

   * Documented the issue where the error below

        BDB0588 At least one secondary cursor must be specified to DB->join

   * DB_File installs to wrong place for CPAN version
     RT #70420
     Makefile.PL prevents INSTALLDIRS on command line.
     RT #68287: Makefile.PL prevents INSTALLDIRS on command line.

   * typo fix
     RT #85335

10 years agoExtUtils::Miniperl: Remove pod repeated phrase
Karl Williamson [Sun, 7 Jul 2013 12:16:11 +0000 (06:16 -0600)]
ExtUtils::Miniperl: Remove pod repeated phrase

10 years agoFix MidnightBSD hints file for 0.4-RELEASE
Chris 'BinGOs' Williams [Sun, 7 Jul 2013 12:55:29 +0000 (13:55 +0100)]
Fix MidnightBSD hints file for 0.4-RELEASE

0.4 has no /usr/bin/objformat, so the hints file was
falling through to configure for aout with fatal consequences.

Confirmed that the objformat in 0.3 warns that it is deprecated.

Have switched around the logic of the checks so that it will always
configure for elf, using aout is explicitly detected.

10 years agoMerge the refactoring of ExtUtils::Miniperl and {mini,}perlmain.c generation.
Nicholas Clark [Sun, 7 Jul 2013 11:36:09 +0000 (13:36 +0200)]
Merge the refactoring of ExtUtils::Miniperl and {mini,}perlmain.c generation.

10 years agoMove the "editor block" from miniperlmain.c to ExtUtils::Miniperl
Nicholas Clark [Sat, 6 Jul 2013 14:21:40 +0000 (16:21 +0200)]
Move the "editor block" from miniperlmain.c to ExtUtils::Miniperl

As miniperlmain.c is now generated by ExtUtils::Miniperl (and not the other
way round), there's no reason to have an editor block in the generated file,
as it's not intended to be edited. Instead, add the "generated from" and
read-only headers to miniperlmain.c

10 years agoClean up ExtUtils::Miniperl
Nicholas Clark [Fri, 5 Jul 2013 22:28:50 +0000 (00:28 +0200)]
Clean up ExtUtils::Miniperl

Give it a $VERSION.
Bring the joy of strict (and warnings) to it.
Inline the C code into writemain() instead of using $head, $tail and a regex
to split the $tail into $tail1, $tail2 and $tail3.
Tweak the NAME section so that ABSTRACT_FROM parses it.
Document the updated functionality of writemain().

10 years agoInvert the build logic for miniperlmain.c and ExtUtils::Miniperl
Nicholas Clark [Fri, 5 Jul 2013 21:16:12 +0000 (23:16 +0200)]
Invert the build logic for miniperlmain.c and ExtUtils::Miniperl

Now ExtUtils::Miniperl has the master version of {mini,}perlmain.c and is
checked into the repository. miniperlmain.c is now generated by a script
in regen/ which uses ExtUtils::Miniperl.

Tweak ExtUtils::Miniperl::writemain() to take an optional first argument,
a reference to a file handle. This permits the regen script to use the
regen_lib.pl functions for file opening/closing/renaming and TAP generation.

For now check in ExtUtils::Miniperl minimally modified from the version
generated by the former minimod.pl. The next commit will tidy it up.

10 years agoMove generation of ExtUtils::Miniperl to ext/ExtUtils-Miniperl from minimod.pl
Nicholas Clark [Thu, 4 Jul 2013 09:28:53 +0000 (11:28 +0200)]
Move generation of ExtUtils::Miniperl to ext/ExtUtils-Miniperl from minimod.pl

It does increase the lines of code slightly but it replaces a bunch of
platform specific special case code in the Makefiles for *nix, Win32 and VMS
with one unified implementation. And in Perl, rather than 3+ different
languages.

This feels like the right maintainability trade-off.

10 years agoMerge the branch which builds utils/Makefile from utils/Makefile.PL
Nicholas Clark [Sun, 7 Jul 2013 10:50:13 +0000 (12:50 +0200)]
Merge the branch which builds utils/Makefile from utils/Makefile.PL

10 years agoGenerate utils/Makefile from utils/Makefile.PL, and remove it at clean time.
Nicholas Clark [Wed, 3 Jul 2013 20:50:08 +0000 (22:50 +0200)]
Generate utils/Makefile from utils/Makefile.PL, and remove it at clean time.

Add rules to the Win32 Makefiles to call utils/Makefile.PL to generate
utils/Makefile, and rules to both them and the *nix Makefile to delete
the generated file as part of the cleanup targets.

VMS continues to do its own thing, rather than using utils/Makefile.

10 years agoReplace utils/Makefile.SH with utils/Makefile.PL
Nicholas Clark [Wed, 3 Jul 2013 16:31:02 +0000 (18:31 +0200)]
Replace utils/Makefile.SH with utils/Makefile.PL

This shares all the existing deficiencies of utils/Makefile.SH, and
generates a byte-for-byte identical utils/Makefile, including boilerplate
that claims it was generated by utils/Makefile.SH

utils/Makefile remains as a file checked into the repository, and is not (yet)
deleted, because as-was only *nix platforms could run utils/Makefile.SH to
generate utils/Makefile. This messy state of affairs means that if you build
with static linking, the checked-out utils/Makefile is modified
('../miniperl' is replaced with '../perl')

The next commit will resolve just these bugs.

In turn, it seems that the pre-generated utils/Makefile is only used by
Win32, as VMS contains rules in descrip_mms.template to build the
utilities. Probably the next thing to unpick is the build on VMS, but it
seems better to reduce the size of the "problem" in both utils/Makefile.PL
and vms/descrip_mms.template by attempting to move the work from them to
the extension directories and ExtUtils::MakeMaker.

10 years agoAdd an "always update" parameter to regen_lib's open_new().
Nicholas Clark [Wed, 3 Jul 2013 13:23:33 +0000 (15:23 +0200)]
Add an "always update" parameter to regen_lib's open_new().

By default the code in regen_lib compares the newly written file it has just
closed with the (assumed) existing file, and only overwrites the existing
file if the new file differs. This is a useful behaviour for regeneration
scripts. However, it's not ideal for build scripts called from the Makefile,
as make assumes that targets will be regenerated (and the timestamp touched).

So add an "always update" parameter for the use of Makefile invoked scripts,
such as autodoc.pl. If set, delete any existing file early (so that fatal
errors during the generation don't confuse the build by leaving an existing
stale file around), skip the comparison and skip the diagnostic output
listing the changed files.

Change autodoc.pl to set this parameter.

Correct a typo in an error message in regen_lib's open_new().

10 years agoRefactor the Text::Wrap::wrap() logic in regen/regen_lib.pl
Nicholas Clark [Wed, 3 Jul 2013 13:51:16 +0000 (15:51 +0200)]
Refactor the Text::Wrap::wrap() logic in regen/regen_lib.pl

Provide a local subroutine wrap(). Pass columns as its first parameter and
set $Text::Wrap::columns, as all uses of Text::Wrap::wrap() were setting
this variable.

10 years agoAdd cpan/Text-Tabs/lib to buildcustomize.pl and hence miniperl's @INC.
Nicholas Clark [Wed, 3 Jul 2013 20:28:50 +0000 (22:28 +0200)]
Add cpan/Text-Tabs/lib to buildcustomize.pl and hence miniperl's @INC.

autodoc.pl already needs Text::Wrap, and soon other early-stage build scripts
will too.

10 years agoRefactor regen_lib.pl to reduce verbosity.
Nicholas Clark [Wed, 3 Jul 2013 13:40:47 +0000 (15:40 +0200)]
Refactor regen_lib.pl to reduce verbosity.

Use hash slices to avoid repeated typeglob dereferences on $fh.
In read_only_top() use a lexical to avoid repeated $args{lang} lookups.

10 years agoto-do tests for #113932 (UNIVERSAL::can and handles)
Father Chrysostomos [Sun, 7 Jul 2013 05:32:53 +0000 (22:32 -0700)]
to-do tests for #113932 (UNIVERSAL::can and handles)

10 years agoStop using IV in pmop; remove workaround
Father Chrysostomos [Sun, 7 Jul 2013 01:00:34 +0000 (18:00 -0700)]
Stop using IV in pmop; remove workaround

See ticket #118055 for all the detail.  On systems where IV is bigger
than a pointer, the slab allocator messes things up because it only
provides pointer alignment.  If pmops have an IV field, we cannot
allocate them via slab on such systems.  Pmops actually don’t need
an IV, just a PADOFFSET.  So we can change them and remove the
workaround.

This is obviously not suitable for maint.

10 years agoSuppress dep warnings in DD’s indent.t
Father Chrysostomos [Sun, 7 Jul 2013 00:58:31 +0000 (17:58 -0700)]
Suppress dep warnings in DD’s indent.t

I considered changing the code to suppress the warning, but:

• The warning only occurs before 5.12; the code is fine in
  later versions.
• By not changing the code I avoid the risk of sabotaging the test.
• By suppressing the warning conditionally based on perl version, we
  will still see future deprecations.

So this seems the least intrusive fix.

10 years agosmall improvements to documentation of IO::Socket
Ricardo Signes [Sat, 6 Jul 2013 19:26:01 +0000 (15:26 -0400)]
small improvements to documentation of IO::Socket

IO::Socket::INET's documentation for its Listen parameter was
somewhat misleading, and the documentation for IO::Socket::Unix
even more so.

See [perl #118713]

10 years agofix SIGZZERO typo in perldoc -f kill
Lukas Mai [Sat, 6 Jul 2013 16:38:50 +0000 (18:38 +0200)]
fix SIGZZERO typo in perldoc -f kill

10 years agoUpdate Time-Piece to CPAN version 1.21
Chris 'BinGOs' Williams [Sat, 6 Jul 2013 18:40:50 +0000 (19:40 +0100)]
Update Time-Piece to CPAN version 1.21

  [DELTA]

  1.21    2013-07-06
          - fix installation target; now installs to site in v5.12 and later
          - make Time::Seconds match its VERSION to Time::Piece
          - numerous portability fixes imported from perl core distribution

10 years agoignore lib/File/Find.pm
Ricardo Signes [Sat, 6 Jul 2013 16:01:07 +0000 (12:01 -0400)]
ignore lib/File/Find.pm

This is a bit of cleanup in the wake of
6de85bb45a5ea25528026a26cac854ee4dcdcd45.

10 years ago[perl #117917] /(?{ m|...| }) (?{ $1 })/
Father Chrysostomos [Sat, 6 Jul 2013 06:59:46 +0000 (23:59 -0700)]
[perl #117917] /(?{ m|...| }) (?{ $1 })/

A regular expression invoked inside a regular expression code block
can cause other code blocks in the same outer regular expression to
see the wrong values in $1.

PL_curpm holds a pointer to the match operator from which $1, $2, etc.
get their values.

Normally PL_curpm is set at the end of a match.

When code blocks are embedded inside a regular expression, PL_curpm
is set during a match to point to PL_reg_curpm, which is a dummy op
pointing to the current regular expression.

S_setup_eval_state is called at the beginning of regexp execution.
It is responsible for setting up PL_regcurpm and making PL_curpm
point to it.

Code blocks are executed using the multicall API.  PUSH_MULTICALL
records the value of PL_curpm and POP_MULTICALL makes sure that the
previous value of PL_curpm is restored.

Executing a code block can cause PL_curpm to point to something else.
Since we don’t necessarily do POP_MULTICALL between code block calls
within a single regular expression (sometimes we do, depending on
backtracking), PL_curpm may not have been restored when a second code
block fires.  So we have to restore it to point to PL_reg_curpm manu-
ally after calling a code block.

10 years agoPATCH: [perl #112208]: Set utf8 flag on $! appropriately
Karl Williamson [Thu, 20 Jun 2013 03:00:53 +0000 (21:00 -0600)]
PATCH: [perl #112208]: Set utf8 flag on $! appropriately

This patch sets the utf8 flag on $! if the error string passes utf8
validity tests and has some bytes with the upper bit set.  (If none
have that bit set, is an ASCII string, and whether or not it is UTF-8 is
irrelevant.)  This is a heuristic that could fail, but as the reference
in the comments points out this is unlikely.

One can reasonably assume that a UTF-8 locale will return a UTF-8
result.  So another approach would be to look at that (but we wouldn't
want to turn the flag on for a purely ASCII string anyway, as that could
change the semantics from existing behavior by making the string follow
Unicode rules, whereas it didn't necessarily before.)  To do this, we
could keep track of the utf8ness of the LC_MESSAGES locale.  But until
the heuristic in this patch is shown to not be good enough, I don't see
the need to do this extra work.

10 years agoAdd new -V output to Config-Perl-V
H.Merijn Brand [Wed, 3 Jul 2013 13:53:11 +0000 (15:53 +0200)]
Add new -V output to Config-Perl-V

10 years agolocale.c: Further checks for utf8ness of a locale
Karl Williamson [Tue, 2 Jul 2013 16:49:04 +0000 (10:49 -0600)]
locale.c: Further checks for utf8ness of a locale

In reality, the return value of setlocale() is documented to be opaque,
so using it to determine if a locale is UTF-8 or not may not work.  It
is a char*, which we treat as a name.  We can safely assume that if the
name contains UTF-8 (or slight variations thereof), that it is a UTF-8
locale.  But if the name doesn't contain that, it still could be one.
In fact there are currently many locales on our dromedary machine that
fall into this category.  Similarly, something containing 8859 is not
going to be UTF-8.

This commit adds another test for cases where there is no nl_langinfo(),
and the locale name isn't helpful.  It looks at the currency symbol,
which typically will be in the locale's script.  If that is illegal
UTF-8, we know for sure that the locale isn't UTF-8 (or is corrupted).
If it is legal UTF-8 (but not ASCII) we can be pretty sure that the
locale is UTF-8.  If it is ASCII, we still don't know one way or the
other, so we err on it not being UTF-8.

Originally, I was going to use the locale's error message strings,
returned from strerror(), the source for $!, to check for this.
These are supposed to be in terms of the  LC_MESSAGES locale.  Chances
are vanishingly small that the locale is not UTF-8 if all the messages
pass a utf8ness test, provided that the messages aren't just ASCII.
However, on dromedary, the messages for many of the exotic locales
haven't been translated, and are still in English, which doesn't help at
all.  I figure that this is quite likely to be the case generally, and
the currency symbol is much more likely to have been translated.
I left the code in though, commented out for possible future use.

Note that this test will run only on systems that don't have
nl_langinfo().  The test can also be turned off by setting a C compiler
flag -DNO_LOCALE_MONETARY, (and -DNO_LOCALE_MESSAGES for the
commented-out part), corresponding to the way the other categories can
be turned off (none of which is documented).

10 years agolocale.c: Extract out, fix, expand fcn to see if a locale is utf8
Karl Williamson [Mon, 24 Jun 2013 23:21:49 +0000 (17:21 -0600)]
locale.c: Extract out, fix, expand fcn to see if a locale is utf8

There was buggy code to see if the start-up locale is UTF-8.  This
commit extracts it into a separate function.

The bugs involved looking at the name of the locale to see if that
implies a UTF-8 name.  Prior to this commit, it looked at the
beginning of the locale name, whereas in reality, it is at the end, as
in "fr_FR.UTF8".

Also, it didn't look for the documented Windows name for UTF-8 locales
on those platforms.

The function is expanded to have an input category to find the utf8ness
of.  Thus it now works on any non-LC_ALL category, not just LC_CTYPE.

It is possible for categories to be in different locales, so that
LC_CTYPE is in a UTF-8 locale, and LC_NUMERIC isn't.  For the purposes
of PERL_UNICODE, the most applicable category is LC_CTYPE, so that is
the one used in its currently only call.

10 years agolocale.c: Compare apples to apples
Karl Williamson [Thu, 27 Jun 2013 20:25:43 +0000 (14:25 -0600)]
locale.c: Compare apples to apples

Prior to this patch, one parameter to strNE would have been through a
standardizing function, while the other had not.  By standardizing both
before doing the compare, we avoid false positives.

10 years agoperl.h, locale.c: White space only
Karl Williamson [Thu, 27 Jun 2013 20:01:01 +0000 (14:01 -0600)]
perl.h, locale.c: White space only

This indents some nested #if's to clarify the program structure.

10 years agolocale.c: Add comments
Karl Williamson [Thu, 27 Jun 2013 19:57:19 +0000 (13:57 -0600)]
locale.c: Add comments

10 years ago[perl #117727] Document B::PADLIST
Father Chrysostomos [Fri, 5 Jul 2013 20:24:12 +0000 (13:24 -0700)]
[perl #117727] Document B::PADLIST

I neglected this when I added that class in perl 5.17.4

10 years agoMove File::Find from lib/ to ext/
Nicholas Clark [Wed, 3 Jul 2013 09:11:06 +0000 (11:11 +0200)]
Move File::Find from lib/ to ext/

10 years agoChange File::Find's tests to look for taint.t instead of commonsense.t
Nicholas Clark [Wed, 3 Jul 2013 08:57:28 +0000 (10:57 +0200)]
Change File::Find's tests to look for taint.t instead of commonsense.t

This passes whether the tests are in lib/ (and hence run with the CWD as t/)
or in ext/File-Find (and hence run with that as the CWD) because they find
t/op/taint.t or ext/File-Find/t/taint.t respectively.

Change taint.t to count the number of times it finds a file named taint.t,
and fail if the count isn't 1. find.t was already testing a count.

10 years agoImprove the BEGIN-time setup code for File::Find's tests.
Nicholas Clark [Wed, 3 Jul 2013 08:41:29 +0000 (10:41 +0200)]
Improve the BEGIN-time setup code for File::Find's tests.

In find.t merge the two BEGIN blocks and eliminate the redundant
C<use File::Spec;>
In both, don't attempt to change directory to t/ (which will be unhelpful
once File::Find is moved to ext/)
Only make paths in @INC absolute if $ENV{PERL_CORE} is set (which will ease
making File::Find dual-life, if we want to this.)

10 years agoAdd Olivier Mengué to AUTHORS
Father Chrysostomos [Fri, 5 Jul 2013 15:13:39 +0000 (08:13 -0700)]
Add Olivier Mengué to AUTHORS

10 years agoIncrease $subs::VERSION to 1.02
Father Chrysostomos [Fri, 5 Jul 2013 15:12:47 +0000 (08:12 -0700)]
Increase $subs::VERSION to 1.02

10 years agosubs.pm: fix variable leak into global scope
Olivier Mengué [Sat, 13 Apr 2013 09:48:40 +0000 (11:48 +0200)]
subs.pm: fix variable leak into global scope

10 years agoUpdate MIME-Base64 to CPAN version 3.14
Chris 'BinGOs' Williams [Fri, 5 Jul 2013 14:21:07 +0000 (15:21 +0100)]
Update MIME-Base64 to CPAN version 3.14

  [DELTA]

  2013-07-02   Gisle Aas <gisle@ActiveState.com>

   Release 3.14

   Install to 'site' instead of 'perl' when perl version is 5.12+

10 years agoUpdate Digest-MD5 to CPAN version 2.53
Chris 'BinGOs' Williams [Fri, 5 Jul 2013 14:20:03 +0000 (15:20 +0100)]
Update Digest-MD5 to CPAN version 2.53

  [DELTA]

  2013-07-02   Gisle Aas <gisle@ActiveState.com>

   Release 2.53

   Drop File::Spec dependency and don't override installation location
   for perl-5.12++

   Documentation tweaks.

10 years agoignore build products from the newly dist/ed Exporter
Tony Cook [Fri, 5 Jul 2013 07:20:57 +0000 (17:20 +1000)]
ignore build products from the newly dist/ed Exporter

10 years agoIntroduce validate_proto / stop stripping spaces
Peter Martini [Mon, 1 Jul 2013 22:13:42 +0000 (18:13 -0400)]
Introduce validate_proto / stop stripping spaces

The code to do warnings on invalid prototypes was a chunk
of 70 or so lines inside the core lexer.  It also had the
side effect of removing spaces from the prototype as part
of its check for warnings.

This validation code is now just a validation, printing
out warnings if and only if warnings are enabled,
and leaving the source SV untouched.