platform/upstream/perl.git
11 years ago[perl #27010] Make tie work through defelems
Father Chrysostomos [Tue, 16 Jul 2013 06:51:15 +0000 (23:51 -0700)]
[perl #27010] Make tie work through defelems

When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.

tie/tied/untie, however, were not delegating to the element, but were
tying the the magical ‘deferred element’ scalar itself.

11 years agoembed.fnc: E does not imply X
Father Chrysostomos [Tue, 16 Jul 2013 05:49:31 +0000 (22:49 -0700)]
embed.fnc: E does not imply X

I thought it did.

11 years agoConvert lib/FileHandle.t to use of Test::More; provide descriptions.
James E Keenan [Wed, 10 Jul 2013 02:13:10 +0000 (04:13 +0200)]
Convert lib/FileHandle.t to use of Test::More; provide descriptions.

Previously, file used hand-coded 'print "ok"' statements and no tests had
descriptions (a.k.a. labels or names).  Convert to use of Test::More functions
and provide descriptions for all individual tests.

Previously, file used global variables extensively and did not 'use strict'
(except 'use strict subs').  The globals have been converted to lexicals
where appropriate and the file now runs fully under strictures.  Other
than that, no attempt was made to improve the design of the file or the
quality of the tests.  (That can be done in a later RT, if desired.)

Thanks to Peter Martini for guidance, Dagfinn Ilmari Mannsåker for guidance
and code review on list and Tony Cook for additional review.

For: RT #118883

11 years agoperldelta for #77814
Father Chrysostomos [Tue, 16 Jul 2013 02:00:21 +0000 (19:00 -0700)]
perldelta for #77814

11 years ago[perl #77814] Make defelems propagate pos
Father Chrysostomos [Tue, 16 Jul 2013 01:57:01 +0000 (18:57 -0700)]
[perl #77814] Make defelems propagate pos

When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.

pos($_[0]), however, was not delegating the value to the element, but
storing it on the magical ‘deferred element’ scalar.

11 years agoperldelta for vstrings and set-magic
Father Chrysostomos [Mon, 15 Jul 2013 07:21:55 +0000 (00:21 -0700)]
perldelta for vstrings and set-magic

11 years agoMake set-magic handle vstrings properly
Father Chrysostomos [Mon, 15 Jul 2013 07:05:57 +0000 (00:05 -0700)]
Make set-magic handle vstrings properly

Assigning a vstring to a tied variable would result in a plain string
in $_[1] in STORE.

Assigning a vstring to a magic deferred element would result in a
plain string in the aggregate’s actual element.

When magic is invoked, the magic flags are temporarily turned off on
the sv so that recursive calls to magic don’t happen.  This makes it
easier to implement functions like Perl_magic_set to read the value of
the sv without triggering get-magic.

Since vstrings are only considered vstrings when they are SvRMAGICAL,
this meant that set-magic would turn vstrings temporarily into plain
strings.  Subsequent copying (e.g., in STORE) would then fail to copy
the vstring magic.

This commit changes mg_set to leave the rmagical flag on, since it
does not affect the functionaiity of set-magic.

11 years agot/op/array.t: remove ‘no warnings "deprecated"’
Father Chrysostomos [Sun, 14 Jul 2013 00:57:46 +0000 (17:57 -0700)]
t/op/array.t: remove ‘no warnings "deprecated"’

The tests using the deprecated feature were removed in e1dccc0d34.

11 years ago[perl #117223] Remove IO::File example from perlfunc
Ed Avis [Tue, 16 Jul 2013 01:17:34 +0000 (11:17 +1000)]
[perl #117223] Remove IO::File example from perlfunc

updated to apply to blead, minor spelling and word wrap fixes by Tony
Cook.

11 years agoParseXS: generate deterministically ordered output
Karl Williamson [Mon, 15 Jul 2013 15:55:40 +0000 (09:55 -0600)]
ParseXS: generate deterministically ordered output

The generated XS file output was varying between builds because of hash
randomisation.  This sorts the output to make it the same for the same
inputs.  This facilitates eyeballing diffs of two workspaces.

11 years agoExtUtils::Embed::canon needs to *globally* substitute / for $as
Nicholas Clark [Mon, 15 Jul 2013 14:58:08 +0000 (16:58 +0200)]
ExtUtils::Embed::canon needs to *globally* substitute / for $as

Otherwise the results are buggy for package names with two or more separators.
This bug broke a -Uusedl build, once ExtUtils::Embed was refactored to use
the existing but always-buggy functionality.

11 years agoThreading 5.005 style is no longer supported
H.Merijn Brand [Mon, 15 Jul 2013 13:53:49 +0000 (15:53 +0200)]
Threading 5.005 style is no longer supported

Modernize the explain message

11 years agoperlexperiment: Sun Studio on Linux: not experimental
Ricardo Signes [Mon, 15 Jul 2013 02:45:16 +0000 (22:45 -0400)]
perlexperiment: Sun Studio on Linux: not experimental

see <20130708133005.GA8284@cancer.codesimply.com>

11 years agoperlexperiment: the M flag is not a useful thing to point out
Ricardo Signes [Mon, 15 Jul 2013 02:44:33 +0000 (22:44 -0400)]
perlexperiment: the M flag is not a useful thing to point out

see <20130708142509.GA8504@cancer.codesimply.com>

11 years agoFix file_name_is_absolute on VMS for device without a directory.
Craig A. Berry [Sun, 14 Jul 2013 19:34:47 +0000 (14:34 -0500)]
Fix file_name_is_absolute on VMS for device without a directory.

To be considered absolute, we had been requiring a file spec to
have a bracketed directory spec after the colon. This meant that
very common and idiomatic expressions such as sys$login:login.com
or sys$manager:operator.log were not considered absolute.  Which
is wrong.

So we now consider a file spec starting with a valid device name
(which would also be a valid logical name) followed by an unescaped
colon to be absolute.

11 years agoSync the Storable version in Maintainers.pl with CPAN version
Chris 'BinGOs' Williams [Sun, 14 Jul 2013 19:23:15 +0000 (20:23 +0100)]
Sync the Storable version in Maintainers.pl with CPAN version

11 years agomention that caller() does not show XSUBs
Daniel Dragan [Sat, 13 Jul 2013 22:20:09 +0000 (18:20 -0400)]
mention that caller() does not show XSUBs

Part of Perl #113438. Someone may write a pure perl sub, or callback from
an XSUB to PP to use caller, to check the package of the sub that called
the current sub and have different behaviour based on the caller sub's
package. Also using a perl debugger will not show XSUB frames in the
call stack. Therefore document this limitation of caller.

11 years agoperldelta: appease podcheck; tweak formatting
Father Chrysostomos [Sat, 13 Jul 2013 23:42:09 +0000 (16:42 -0700)]
perldelta: appease podcheck; tweak formatting

11 years agoperldelta for #118839/bf2614180a65
Father Chrysostomos [Sat, 13 Jul 2013 23:39:28 +0000 (16:39 -0700)]
perldelta for #118839/bf2614180a65

11 years agoperldelta for #118567/50278ed0f
Father Chrysostomos [Sat, 13 Jul 2013 23:38:01 +0000 (16:38 -0700)]
perldelta for #118567/50278ed0f

11 years agoperldelta for #89648/b23eb1831
Father Chrysostomos [Sat, 13 Jul 2013 23:36:37 +0000 (16:36 -0700)]
perldelta for #89648/b23eb1831

11 years agoperldelta for #118627/4e917a04b78
Father Chrysostomos [Sat, 13 Jul 2013 23:33:06 +0000 (16:33 -0700)]
perldelta for #118627/4e917a04b78

11 years agoperldelta for f791a21a2018
Father Chrysostomos [Sat, 13 Jul 2013 23:30:37 +0000 (16:30 -0700)]
perldelta for f791a21a2018

11 years agoperldiag: rewrap an entry for better splain output
Father Chrysostomos [Sat, 13 Jul 2013 23:28:36 +0000 (16:28 -0700)]
perldiag: rewrap an entry for better splain output

11 years agoperldelta for b54d603d2 (consistent proto warnings)
Father Chrysostomos [Sat, 13 Jul 2013 23:23:13 +0000 (16:23 -0700)]
perldelta for b54d603d2 (consistent proto warnings)

11 years agoperldelta for a77c16f7c (*foo->bar)
Father Chrysostomos [Sat, 13 Jul 2013 23:20:43 +0000 (16:20 -0700)]
perldelta for a77c16f7c (*foo->bar)

11 years agoperldelta for #113932 (UNIVERSAL::can)
Father Chrysostomos [Sat, 13 Jul 2013 23:16:13 +0000 (16:16 -0700)]
perldelta for #113932 (UNIVERSAL::can)

11 years agoperldelta for #117917/f5df269c5c
Father Chrysostomos [Sat, 13 Jul 2013 23:13:02 +0000 (16:13 -0700)]
perldelta for #117917/f5df269c5c

11 years agoperldelta for fdf416b69a0 (utf8 cloned protos)
Father Chrysostomos [Sat, 13 Jul 2013 21:43:24 +0000 (14:43 -0700)]
perldelta for fdf416b69a0 (utf8 cloned protos)

11 years agoperldelta for 9700e2d38 (ambiguity warnings)
Father Chrysostomos [Sat, 13 Jul 2013 21:41:12 +0000 (14:41 -0700)]
perldelta for 9700e2d38 (ambiguity warnings)

11 years agoperldelta for e9d9e6f34 (list cx for sort args)
Father Chrysostomos [Sat, 13 Jul 2013 21:39:17 +0000 (14:39 -0700)]
perldelta for e9d9e6f34 (list cx for sort args)

11 years agoperldelta for f65493df1c (lv sort args)
Father Chrysostomos [Sat, 13 Jul 2013 21:37:38 +0000 (14:37 -0700)]
perldelta for f65493df1c (lv sort args)

11 years agoperldelta for 20d5dc239 (fatal in-place sort)
Father Chrysostomos [Sat, 13 Jul 2013 21:35:49 +0000 (14:35 -0700)]
perldelta for 20d5dc239 (fatal in-place sort)

11 years agoperldelta for bdbfc51a7b (undef constant my sub)
Father Chrysostomos [Sat, 13 Jul 2013 21:31:31 +0000 (14:31 -0700)]
perldelta for bdbfc51a7b (undef constant my sub)

11 years agoperldelta for 5e5128ba (@INC and scalarref docs)
Father Chrysostomos [Sat, 13 Jul 2013 21:30:11 +0000 (14:30 -0700)]
perldelta for 5e5128ba (@INC and scalarref docs)

11 years agoperldelta for ee3818ca2c5e (Can’t coerce readonly REF)
Father Chrysostomos [Sat, 13 Jul 2013 21:28:29 +0000 (14:28 -0700)]
perldelta for ee3818ca2c5e (Can’t coerce readonly REF)

11 years agoperldelta for c72a4eedf (sv_force_normal at compile time)
Father Chrysostomos [Sat, 13 Jul 2013 21:28:01 +0000 (14:28 -0700)]
perldelta for c72a4eedf (sv_force_normal at compile time)

11 years agoperldelta for 9657ccb4f (@INC sub returning scalar ref)
Father Chrysostomos [Sat, 13 Jul 2013 21:17:16 +0000 (14:17 -0700)]
perldelta for 9657ccb4f (@INC sub returning scalar ref)

11 years agoperldelta: typos; consistency tweaks
Father Chrysostomos [Sat, 13 Jul 2013 19:14:19 +0000 (12:14 -0700)]
perldelta: typos; consistency tweaks

11 years agoperldelta for 310f4fdb24 (more index constant mangling)
Father Chrysostomos [Sat, 13 Jul 2013 19:13:21 +0000 (12:13 -0700)]
perldelta for 310f4fdb24 (more index constant mangling)

11 years agoperldelta for 948d23704 (index constant mangling)
Father Chrysostomos [Sat, 13 Jul 2013 19:09:45 +0000 (12:09 -0700)]
perldelta for 948d23704 (index constant mangling)

11 years agoperldelta for 60041a0991 (split constant mangling)
Father Chrysostomos [Sat, 13 Jul 2013 19:08:47 +0000 (12:08 -0700)]
perldelta for 60041a0991 (split constant mangling)

11 years agoperldelta for proto parsing changes
Father Chrysostomos [Sat, 13 Jul 2013 19:06:24 +0000 (12:06 -0700)]
perldelta for proto parsing changes

11 years agoperldelta for 8922e438 (BmRARE/PREVIOUS removal)
Father Chrysostomos [Sat, 13 Jul 2013 19:06:15 +0000 (12:06 -0700)]
perldelta for 8922e438 (BmRARE/PREVIOUS removal)

11 years agoperldelta for #118305/88dbe4a
Father Chrysostomos [Sat, 13 Jul 2013 18:57:02 +0000 (11:57 -0700)]
perldelta for #118305/88dbe4a

11 years agoWrap a long verbatim line in perlvar.pod
Father Chrysostomos [Sat, 13 Jul 2013 21:19:48 +0000 (14:19 -0700)]
Wrap a long verbatim line in perlvar.pod

11 years ago[perl #118839] Make ‘n’ debugger cmd respect lv subs
Father Chrysostomos [Sat, 13 Jul 2013 18:41:44 +0000 (11:41 -0700)]
[perl #118839] Make ‘n’ debugger cmd respect lv subs

The ‘n’ debugger command, which is supposed to step over subs, was not
stepping over lvalue subs.

This is a regression from 5.8, but 5.8 was worse.

This bug did not occur in 5.8 because there was no mechanism back then
for handling lvalue subs specially (via DB::lsub), so assignment to an
lvalue sub was completely broken under the debugger.

Perl 5.10 introduced DB::lsub.  The implementation in perl5db.pl
contains these lines at the end of the sub:

    # Pop the single-step value back off the stack.
    $single |= $stack[ $stack_depth-- ];

    # call the original lvalue sub.
    &$sub;

The regular DB::sub does this:

        {
            no strict 'refs';
            @ret = &$sub;
        }

        # Pop the single-step value back off the stack.
        $single |= $stack[ $stack_depth-- ];

Notice how $single (i.e., $DB::single) is modified before and after
the sub call, respectively.  The order is different.

There are two types of lvalue list context for lvalue subs.  (foo)=3
will allow sub foo:lvalue{@a} to return the array itself.  \(foo) and
bar(foo) will flatten the array.

So there is no way in pure Perl to capture the return value and have
it returned to the caller unchanged.  That is why DB::lsub has to call
the sub last of all (and have the context propagated).

The solution here is to use localisation to accomplish the assigment
to $single after the lvalue sub exits.

11 years agoperl5db.pl: Remove obsolete comment
Father Chrysostomos [Sat, 13 Jul 2013 08:12:20 +0000 (01:12 -0700)]
perl5db.pl: Remove obsolete comment

The regexp engine is now fully reëntrant.

11 years agotodo.pod: Don’t mention ‘make test.taintwarn’
Father Chrysostomos [Sat, 13 Jul 2013 08:06:46 +0000 (01:06 -0700)]
todo.pod: Don’t mention ‘make test.taintwarn’

11 years agotodo.pod: Class set regexp operations are done
Father Chrysostomos [Sat, 13 Jul 2013 08:02:24 +0000 (01:02 -0700)]
todo.pod: Class set regexp operations are done

but they are still experimental.

11 years agoEdit ChangeLog, Bump VERSION before rebase/release
Abhijit Menon-Sen [Sat, 13 Jul 2013 15:59:49 +0000 (21:29 +0530)]
Edit ChangeLog, Bump VERSION before rebase/release

11 years agoTweak the new Storable destroy test, and the ChangeLog
Nicholas Clark [Tue, 28 May 2013 21:10:30 +0000 (23:10 +0200)]
Tweak the new Storable destroy test, and the ChangeLog

Use Test::More instead of Test, as all the other tests now use Test::More.
Use 2-argument open to be compatible with 5.005. (Where it passes)
Close the test file before unlinking it.
Check the error returns of open and close.
Update the comment now that we have a better understanding of the bug's cause.

As the previous commit as applied had no 5.6 compatibility changes, remove
that note from the ChangeLog.

11 years ago[perl #118139] Storable 2.42 - die in global destruction
Reini Urban [Tue, 28 May 2013 20:46:12 +0000 (22:46 +0200)]
[perl #118139] Storable 2.42 - die in global destruction

Protect against SEGV during global destruction, e.g. when used
in DESTROY blocks.

[Part of a patch submitted by Reini. MANIFEST change added by the committer]

11 years agoUse magic rather than DESTROY to free memory in Storable's context.
Nicholas Clark [Tue, 28 May 2013 20:36:48 +0000 (22:36 +0200)]
Use magic rather than DESTROY to free memory in Storable's context.

Suggested by Leon Timmermans.

11 years agoRestore Storable support for 5.005 and (astoundingly) 5.004
Nicholas Clark [Tue, 28 May 2013 19:37:06 +0000 (21:37 +0200)]
Restore Storable support for 5.005 and (astoundingly) 5.004

It even passes all tests on 5.004.

11 years agoMerge the refactoring of the Makefile install targets into blead.
Nicholas Clark [Sat, 13 Jul 2013 11:29:38 +0000 (13:29 +0200)]
Merge the refactoring of the Makefile install targets into blead.

11 years agoDon't call CPAN to install any "extra" modules for the install-notify target.
Nicholas Clark [Wed, 25 Apr 2012 20:00:09 +0000 (22:00 +0200)]
Don't call CPAN to install any "extra" modules for the install-notify target.

Previously the Makefile's install-notify target built extra.install just like
the other 5 install targets. However, the other 5 actually install perl,
whereas install-notify (a.k.a. no-install) runs installperl and installman
with the --notify option (formerly -n), to cause them to print what they would
do but take no action. Hence if -Dextras was used, make no-install would
actually install the extra modules, but nothing else. This is inconsistent.

11 years agoInline the Makefile rule for extra.install into all 6 targets which use it.
Nicholas Clark [Wed, 25 Apr 2012 18:04:08 +0000 (20:04 +0200)]
Inline the Makefile rule for extra.install into all 6 targets which use it.

This eliminates 6 recursive calls from Makefile to itself. As five of these
are generated from a loop in Makefile.SH, this isn't massive code
duplication. It's not obvious how to merge the sixth without increasing the
code complexity.

Additionally, if the user has specified extra modules to download and build
from CPAN using Configure's -Dextra, this avoids building perl, the non-XS
modules and the CPAN modules twice on make install.

11 years agoRefactor Makefile.SH to generate the install-* targets in a loop.
Nicholas Clark [Wed, 25 Apr 2012 16:28:39 +0000 (18:28 +0200)]
Refactor Makefile.SH to generate the install-* targets in a loop.

This slightly reduces the line count, merges five-fold duplication into one,
and works toward removing 5 recursive calls from Makefile to itself.

11 years agoIn Makefile.SH, use the long names for options passed to install{perl,man}
Nicholas Clark [Wed, 25 Apr 2012 16:05:24 +0000 (18:05 +0200)]
In Makefile.SH, use the long names for options passed to install{perl,man}

This makes it clearer what is going on, and enables a simplifying refactoring.

11 years agoRefactor the Makefile so that the install target depends on install-all.
Nicholas Clark [Tue, 24 Apr 2012 16:41:47 +0000 (18:41 +0200)]
Refactor the Makefile so that the install target depends on install-all.

Also, add targets install_notify and install-notify, as synonyms for
no_install and no-install. Previously install, install-all and install_all
were all generated by the same rule.

These changes make future refactoring easier.

11 years agoMerge installperl and installman refactoring to blead.
Nicholas Clark [Sat, 13 Jul 2013 10:16:57 +0000 (12:16 +0200)]
Merge installperl and installman refactoring to blead.

11 years agoDocument installperl and installman refactoring in perldelta.pod
Nicholas Clark [Sat, 13 Jul 2013 10:16:20 +0000 (12:16 +0200)]
Document installperl and installman refactoring in perldelta.pod

11 years agoAdd a no-op option --strip to installman.
Nicholas Clark [Wed, 25 Apr 2012 13:48:33 +0000 (15:48 +0200)]
Add a no-op option --strip to installman.

This intentionally does nothing.

--strip for installperl instructs it to strip the installed binaries. Hence
by permitting installman to accept --strip without error Makefile.SH can be
simplified, as it's possible to pass identical flags to both install scripts.

11 years agoRefactor installman's option handling to use Getopt::Long's "multiple names".
Nicholas Clark [Wed, 25 Apr 2012 13:21:54 +0000 (15:21 +0200)]
Refactor installman's option handling to use Getopt::Long's "multiple names".

Previously installman specified synonyms for options as distinct
options, and then used explicit code to merge them.

Also add -h and -? as synonyms for --help.

11 years agoConvert installperl to use Getopt::Long.
Nicholas Clark [Wed, 25 Apr 2012 12:38:00 +0000 (14:38 +0200)]
Convert installperl to use Getopt::Long.

This requires some special handling for the +v option. Fortunately, we can
cheat, because we know that no other non-options are acceptable. This does
change the behaviour slightly from before:

* single letter options now also have long names
* invalid options are now rejected
* command line arguments that are not options are now rejected

However, the behaviour for all valid documented invocations is unchanged.

Also, add a --help option to display the usage message.

11 years agoIn installperl rename $opt{dostrip} to $opt{strip}.
Nicholas Clark [Wed, 25 Apr 2012 14:57:22 +0000 (16:57 +0200)]
In installperl rename $opt{dostrip} to $opt{strip}.

This will provide a more meaningful long option name once installperl is
converted to Getopt::Long.

11 years agoIn installperl, record the state of options in %opts instead of lexicals.
Nicholas Clark [Wed, 25 Apr 2012 11:17:41 +0000 (13:17 +0200)]
In installperl, record the state of options in %opts instead of lexicals.

Replace all lexicals used to track the state of command line options with
entries in the hash %opts. Make an exception for $versiononly, as it is
controlled by 2 different command line options, and accessed in significantly
more places than the state of any other command line option.

11 years agoIn installperl, invert the sense of the variable used for the -o option.
Nicholas Clark [Wed, 25 Apr 2012 10:47:53 +0000 (12:47 +0200)]
In installperl, invert the sense of the variable used for the -o option.

Previously it was $otherperls, and had to have its default of 1 explicitly
set. Change it to $skip_otherperls, and the default default of undef is
perfect.

11 years agoRemove dead code from installperl, related to a 5.000->5.001 change.
Nicholas Clark [Wed, 25 Apr 2012 10:06:26 +0000 (12:06 +0200)]
Remove dead code from installperl, related to a 5.000->5.001 change.

5.000 installed autosplit files into archlib. 5.001 and later install into
privlib. archlib is earlier in @INC. It wasn't until 5.005 that perl put the
version number into the paths used for privlib and archlib, hence without
special treatment, the files installed by 5.001 would not be found, because
those from 5.000 would be earlier in @INC.

See commit a841533b5cf319b3 (Oct 2009) which removes similar special casing
code dealing with perldiag.pod confusion between 5.003 and 5.004

All this code became redundant when 5.005 added the version number to
library paths. (strictly, commit bfb7748a896459cc in Jul 1998)

11 years agoGenerate Errno and Pod::Functions with deterministic order.
Nicholas Clark [Fri, 12 Jul 2013 14:50:13 +0000 (16:50 +0200)]
Generate Errno and Pod::Functions with deterministic order.

Previously the order of duplicate names in Errno was determined by hash
iteration order, as was the order of the list of types for built-ins in
Pod::Functions. With hash randomisation this meant that the generated file
could differ between builds, which isn't ideal if the input is the same.

(Spotted as a side effect of running a diff on two installation trees.)

11 years ago[perl #118567] Add a warning for prototypes if a missing
Peter Martini [Sat, 13 Jul 2013 02:10:06 +0000 (22:10 -0400)]
[perl #118567] Add a warning for prototypes if a missing
 closing bracket is detected

11 years agodiagnostics.t: Adjust tests
Father Chrysostomos [Sat, 13 Jul 2013 07:38:39 +0000 (00:38 -0700)]
diagnostics.t: Adjust tests

They are sensitive to changes in perldiag.pod

11 years agoperlvar: Don’t mention dev version
Father Chrysostomos [Sat, 13 Jul 2013 07:27:00 +0000 (00:27 -0700)]
perlvar: Don’t mention dev version

Also, use the v convention used elsewhere in the same doc.

11 years agocheckAUTHORS.pl: Add alt addr for Kent Fredric
Father Chrysostomos [Sat, 13 Jul 2013 07:25:04 +0000 (00:25 -0700)]
checkAUTHORS.pl: Add alt addr for Kent Fredric

11 years agopod/perl5180delta.pod: Clarify %ENV Changes
Kent Fredric [Sat, 15 Dec 2012 13:13:39 +0000 (02:13 +1300)]
pod/perl5180delta.pod: Clarify %ENV Changes

Clarifies the slightly vague ( and  possibly wrong ) explanation for the change in %ENV behaviour.

11 years agopod/perlvar.pod: Document changes to %ENV
Kent Fredric [Sat, 15 Dec 2012 10:21:29 +0000 (23:21 +1300)]
pod/perlvar.pod: Document changes to %ENV

Including Historical context, and relevance to IPC.

reformatted with Jim Keenans Suggestions

11 years agodiag.t: Handle ckWARN2reg_d properly
Father Chrysostomos [Sat, 13 Jul 2013 07:13:20 +0000 (00:13 -0700)]
diag.t: Handle ckWARN2reg_d properly

11 years agoMove folding rules warning from 'D' to 'S'.
James E Keenan [Sun, 17 Feb 2013 00:58:26 +0000 (19:58 -0500)]
Move folding rules warning from 'D' to 'S'.

For RT #89648

11 years ago[perl #89648] Remove ‘Perl folding rules...’ from dep cat
Father Chrysostomos [Sat, 13 Jul 2013 07:07:20 +0000 (00:07 -0700)]
[perl #89648] Remove ‘Perl folding rules...’ from dep cat

This warning message:

Perl folding rules are not up-to-date for 0x%x; please use the perlbug utility to report;

is in both ‘regexp’ and ‘deprecated’ warning categories. It is under
deprecated warnings so that it has a better chance of showing up.

I think this logic is faulty, because it’s not the deprecatedness that
makes a warning show up by default, but its defaultness; i.e., whether
Perl_ck_warner_d is used instead of Perl_ck_warner. The wide character
warning, for instance, is not under ‘deprecated’, but only ‘utf8’. Yet
it’s a default warning marked as S in perldiag. I think this message
should be treated similarly (and listed with (S regex)).

The next commit will update perldiag accordingly.

11 years agoRevert "[perl #118525] Return B::HEK for B::CV::GV of lexical subs"
Father Chrysostomos [Sat, 13 Jul 2013 06:33:06 +0000 (23:33 -0700)]
Revert "[perl #118525] Return B::HEK for B::CV::GV of lexical subs"

This reverts commit 8748370e90a24f3901d476f43ed77f1ac3d861f4.

There appears to be a typemap problem.  I accidentally pushed the patch
too soon.  Sorry for the noise.

11 years agoRevert "Allow => to quote built-in keywords across lines"
Father Chrysostomos [Sat, 13 Jul 2013 06:23:20 +0000 (23:23 -0700)]
Revert "Allow => to quote built-in keywords across lines"

This reverts commit 5969c5766a5d3f6b42a5140548d7c3d6812fec8b.

It appears to be failing with non-mad builds.

11 years ago[perl #118525] Return B::HEK for B::CV::GV of lexical subs
Reini Urban [Thu, 11 Jul 2013 17:09:15 +0000 (12:09 -0500)]
[perl #118525] Return B::HEK for B::CV::GV of lexical subs

A lexsub has a hek instead of a gv. Provide a ref to a PV for the name
in the new B::HEK class.
This crashed previously accessing the not existing SvFLAGS of the hek.

11 years ago[perl #118857] Test punct vars’ exemption from ‘once’ warnings
Father Chrysostomos [Sat, 13 Jul 2013 06:18:08 +0000 (23:18 -0700)]
[perl #118857] Test punct vars’ exemption from ‘once’ warnings

11 years ago[perl #113932] Make UNIVERSAL::can("STDOUT"...) work
Father Chrysostomos [Sat, 13 Jul 2013 05:53:48 +0000 (22:53 -0700)]
[perl #113932] Make UNIVERSAL::can("STDOUT"...) work

For consistency with the way method lookup works, UNIVERSAL::can(...)
should treat a bareword representing a filehandle as a lookup in the
IO::File package (or whichever package implements that filehandle
object).

11 years agoperldiag: reflow an entry for better splain output
Father Chrysostomos [Sat, 13 Jul 2013 05:40:04 +0000 (22:40 -0700)]
perldiag: reflow an entry for better splain output

11 years agoAllow => to quote built-in keywords across lines
Father Chrysostomos [Sat, 13 Jul 2013 05:34:48 +0000 (22:34 -0700)]
Allow => to quote built-in keywords across lines

If I have a sub I can use its name as a bareword as long as I suffix
it with =>, even if the => is on the next line:

$ ./perl -Ilib -e 'sub tim; warn tim' -e '=>'
tim at -e line 1.

If I want to use a built-in keyword’s name as a bareword, I can put =>
after it:

$ ./perl -Ilib -e 'warn time =>'
time at -e line 1.

But if I combine the two (keyword + newline), it does not work:

$ ./perl -Ilib -e 'warn time' -e ' =>'
1373611283 at -e line 1.

unless I override the keyword:

$ ./perl -Ilib -Msubs=time -e 'warn time' -e ' =>'
time at -e line 1.

=> after a bareword is checked for in two places in toke.c.  The first
comes before a comment saying ‘NO SKIPSPACE BEFORE HERE!’; it only
skips spaces and finds a => on the same line.  The second comes later;
it skips vertical space and comments, too.

But the second check is in a code path that is not reached by keywords
that are not overridden (as is the ‘NO SKIPSPACE’ comment).

This commit adds an extra check for built-in keywords after we have
determined that the keyword is not overridden.  In that case, there is
no reason we cannot use skipspace, as we no longer have to worry about
what PL_oldbufptr etc. point to.

This commit leaves __DATA__ and __END__ alone, since they
are special, problematic and controversial.  (See, e.g.,
<https://rt.perl.org/rt3/Ticket/Display.html?id=78348#txn-1234355>.)

11 years agot/base/lex.t: Test pyoq with comment before delim
Father Chrysostomos [Fri, 12 Jul 2013 05:46:22 +0000 (22:46 -0700)]
t/base/lex.t: Test pyoq with comment before delim

perlop says:

There can be whitespace between the operator and the quoting
characters, except when C<#> is being used as the quoting character.
C<q#foo#> is parsed as the string C<foo>, while C<q #foo#> is the
operator C<q> followed by a comment.  Its argument will be taken
from the next line.

But I do not find tests for this anywhere.  Here are some.

11 years agoPOD inside of a function call is inadvisable.
James E Keenan [Sat, 13 Jul 2013 00:59:22 +0000 (02:59 +0200)]
POD inside of a function call is inadvisable.

Documentation suggestions based largely on suggestions by
Aaron J Trevena and Brad Gilbert.

For: RT #68706

11 years agoAdd a const qualifier for the arg to the S_CvGV inline function in cv.h.
Andy Dougherty [Fri, 12 Jul 2013 13:26:18 +0000 (09:26 -0400)]
Add a const qualifier for the arg to the S_CvGV inline function in cv.h.

In addition to correctly describing the behavior of S_CvGV, this avoids
warnings in op.c:Perl_report_redefined_cv, where the old (CV *) cast
removed the 'const' qualifier.  Observed on OpenBSD 5.2 with gcc-4.2.1.

11 years agoperldiag: note the exceptions for "once" warnings
Ricardo Signes [Fri, 12 Jul 2013 15:33:44 +0000 (11:33 -0400)]
perldiag: note the exceptions for "once" warnings

11 years agoFor -DPERL_GLOBAL_STRUCT, eliminate local variable plvarsp in main().
Nicholas Clark [Wed, 26 Jun 2013 16:24:19 +0000 (18:24 +0200)]
For -DPERL_GLOBAL_STRUCT, eliminate local variable plvarsp in main().

11 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

11 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

11 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.

11 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

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

11 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

11 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.

11 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/