This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
12 years agomktables: Change function name
Karl Williamson [Fri, 30 Dec 2011 16:11:23 +0000 (09:11 -0700)]
mktables: Change function name

This is in preparation for Unicode 6.1 for which the new name will make
more sense.

12 years agomktables: Unicode 6.1 table will be empty
Karl Williamson [Fri, 30 Dec 2011 16:02:48 +0000 (09:02 -0700)]
mktables: Unicode 6.1 table will be empty

So, change mktables so it is expecting that.

12 years agomktables: Add comment
Karl Williamson [Fri, 30 Dec 2011 16:02:02 +0000 (09:02 -0700)]
mktables: Add comment

12 years agoUnicode:UCD: Add comments
Karl Williamson [Fri, 30 Dec 2011 15:55:49 +0000 (08:55 -0700)]
Unicode:UCD: Add comments

12 years agoUnicode::UCD: Extend prop_invmap() to handle multi-entries per code point
Karl Williamson [Fri, 30 Dec 2011 15:51:34 +0000 (08:51 -0700)]
Unicode::UCD: Extend prop_invmap() to handle multi-entries per code point

This is in preparation for Unicode 6.1, in which the Name_Alias property
has more than one entry in its table per code point.

12 years agoUnicode::UCD: white-space only
Karl Williamson [Fri, 30 Dec 2011 15:47:48 +0000 (08:47 -0700)]
Unicode::UCD: white-space only

12 years agoUnicode::UCD: Allow prop_invlist() to work on non-compact tables
Karl Williamson [Fri, 30 Dec 2011 15:46:01 +0000 (08:46 -0700)]
Unicode::UCD: Allow prop_invlist() to work on non-compact tables

This accumulates adjacent ranges in case the table is not stored
compactly.

12 years agoUnicode::UCD: Special case prop_aliases() 'indic'
Karl Williamson [Fri, 30 Dec 2011 15:37:04 +0000 (08:37 -0700)]
Unicode::UCD: Special case prop_aliases() 'indic'

This is in preparation for Unicode 6.1 which adds a property whose name
begins with 'indic', as in Indic languages.  This creates a conflict
with Perl's longstanding use of 'in' as a prefix in a property name.
"\p{infoo}" is a synonym for "\p{blk=foo}".  The conflict is resolved
here with a special case.

12 years agoUnicode::UCD: Allow prop_invmap() to work on non-compact binary properties
Karl Williamson [Fri, 30 Dec 2011 04:54:42 +0000 (21:54 -0700)]
Unicode::UCD: Allow prop_invmap() to work on non-compact binary properties

It may be that the tables input to prop_invmap() are not in the most
compact form.  There was a problem coping with these on binary
properties; which this commit fixes by realizing that a binary property
omits its 'Y' property value.

The .t does not pass these tests when the input is not compact, though.

12 years agoUnicode::UCD: Correct pod
Karl Williamson [Fri, 30 Dec 2011 04:48:35 +0000 (21:48 -0700)]
Unicode::UCD: Correct pod

The example is wrong; now the full script names are output, not the
short ones.

12 years agoAdd a test for "n EXPR()".
Shlomi Fish [Sat, 24 Dec 2011 20:03:58 +0000 (22:03 +0200)]
Add a test for "n EXPR()".

12 years agoperl -d: add a test for s EXPR().
Shlomi Fish [Tue, 13 Dec 2011 17:03:06 +0000 (19:03 +0200)]
perl -d: add a test for s EXPR().

This patch involves addding another "perl -d" input script that contains a
subroutine that isn't called by default.

12 years agoperl -d: add a test to the 's' command.
Shlomi Fish [Tue, 13 Dec 2011 16:41:32 +0000 (18:41 +0200)]
perl -d: add a test to the 's' command.

Conflicts:

lib/perl5db.t

12 years agoAdd a test for s.
Shlomi Fish [Sun, 11 Dec 2011 20:41:35 +0000 (22:41 +0200)]
Add a test for s.

12 years agoperl -d: test for 'T'.
Shlomi Fish [Sun, 11 Dec 2011 19:49:29 +0000 (21:49 +0200)]
perl -d: test for 'T'.

12 years agoperl -d: add test for the x command.
Shlomi Fish [Sat, 10 Dec 2011 15:23:04 +0000 (17:23 +0200)]
perl -d: add test for the x command.

12 years agoAdd a test for the debugger p command.
Shlomi Fish [Sat, 10 Dec 2011 14:17:04 +0000 (16:17 +0200)]
Add a test for the debugger p command.

12 years agoUpdate CGI to CPAN version 3.59
Chris 'BinGOs' Williams [Fri, 30 Dec 2011 15:35:54 +0000 (15:35 +0000)]
Update CGI to CPAN version 3.59

  [DELTA]

  Version 3.59 Dec 29th, 2011

  [BUG FIXES]
  - We no longer read from STDIN when the Content-Length is not set, preventing
    requests with no Content-Length from freezing in some cases. This is consistent
    with the CGI RFC 3875, and is also consistent with CGI::Simple. However, the old
    behavior may have been expected by some command-line uses of CGI.pm.
    Thanks to Philip Potter and Yanick Champoux. See RT#52469 for details:
    https://rt.cpan.org/Public/Bug/Display.html?id=52469

  [INTERNALS]
  - remove tmpdirs more aggressively. Thanks to rjbs (RT#73288)
  - use Text::ParseWords instead of ancient shellwords.pl. Thanks to AlexBio.
  - remove use of define(@arr). Thanks to rjbs.
  - spelling fixes. Thanks to Gregor Herrmann and Alessandro Ghedini.
  - fix test count and warning in t/fast.t. Thanks to Yanick.

12 years agoClarify that \Q, \U, \L don't require \E
Eric Brine [Fri, 30 Dec 2011 05:55:40 +0000 (21:55 -0800)]
Clarify that \Q, \U, \L don't require \E

Signed-off-by: Abigail <abigail@abigail.be>
12 years agoNote POSIX changes in perldelta.
Nicholas Clark [Fri, 30 Dec 2011 13:23:53 +0000 (14:23 +0100)]
Note POSIX changes in perldelta.

12 years agoProvide the correct POSIX return value for POSIX::dup2() on Win32.
Nicholas Clark [Fri, 9 Dec 2011 12:09:07 +0000 (13:09 +0100)]
Provide the correct POSIX return value for POSIX::dup2() on Win32.

Microsoft, in their wisdom, chose to ignore the POSIX spec when implementing
their dup2(), and have theirs return 0 on success, instead of the file
descriptor. It seems that no other vendor is this, um, "special", so code
the exception directly, as we don't run Configure on Win32, so there's little
point probing for this.

This resolves RT #98912.

12 years agoConvert POSIX::sleep to an XS wrapper for PerlProc_sleep().
Nicholas Clark [Thu, 8 Dec 2011 15:46:21 +0000 (16:46 +0100)]
Convert POSIX::sleep to an XS wrapper for PerlProc_sleep().

Previously it was a Perl wrapper for CORE::sleep, converting CORE::sleep's
return value of elapsed time slept into the POSIX return value of seconds
remaining. However, that approach could sometimes return a negative result
if CORE::sleep had slept for more than a second longer than the requested
time.

12 years agoperldelta for Unicode::UCD change
Karl Williamson [Fri, 30 Dec 2011 04:52:45 +0000 (21:52 -0700)]
perldelta for Unicode::UCD change

12 years agoUnicode::UCD: Use 6.1 format for Name_Alias
Karl Williamson [Fri, 30 Dec 2011 02:14:07 +0000 (19:14 -0700)]
Unicode::UCD: Use 6.1 format for Name_Alias

The Name_Alias property is changing significantly in Unicode 6.1.  It
will have an extra value for each alias (and there will be a lot more
aliases).  That extra value is considered informative, and gives the
type of alias this is.  prop_invmap() should return both the alias and
its type.  This commit changes it so that even in 6.0, it will return
what it is going to return in 6.1 (for the 6.0 aliases).

This function has not been released in a stable Perl version.  Thus,
this gets the ultimate format into Perl before anyone has come to depend
on the earlier one.

squish

12 years agoregcomp.c: Silence valgrind warning
Karl Williamson [Fri, 23 Dec 2011 00:58:20 +0000 (17:58 -0700)]
regcomp.c: Silence valgrind warning

This happens only in doing debug output.  Initialize these two debugging
variables

12 years agomktables: Add comment
Karl Williamson [Tue, 27 Dec 2011 20:47:36 +0000 (13:47 -0700)]
mktables: Add comment

12 years agomktables: Arrange to handle 6.1 ScriptExtensions.txt
Karl Williamson [Tue, 27 Dec 2011 18:12:47 +0000 (11:12 -0700)]
mktables: Arrange to handle 6.1 ScriptExtensions.txt

Unlike 6.0, this property is listed in 6.1's PropValueAliases.txt, so is
automatically created in 6.1.  Thus this needs to be checked for and the
initialization moved out of the constructor.

12 years agomktables: Accommodate new @missings in Unicode 6.1
Karl Williamson [Tue, 27 Dec 2011 17:51:58 +0000 (10:51 -0700)]
mktables: Accommodate new @missings in Unicode 6.1

The Unicode 6.1 release candidate includes a new @missings line for the
ScriptExtenstions.txt file which we need to know about and deal with.

12 years agomktables: Make protected method available
Karl Williamson [Tue, 27 Dec 2011 17:46:54 +0000 (10:46 -0700)]
mktables: Make protected method available

This is needed in 6.1 for a special case.  It still should be used only
in limited circumstances so is still protected (meaning only that its
name begins with an underscore).

12 years agomktables: Add capability to add dup FIFO
Karl Williamson [Tue, 27 Dec 2011 17:12:26 +0000 (10:12 -0700)]
mktables: Add capability to add dup FIFO

This is in preparation for Unicode 6.1.  This adds the capability for a
duplicate code point to be added to a table after all existing
duplicates.  Previously, new duplicates were added before any existing
ones.

12 years agomktables: Rename variable
Karl Williamson [Tue, 27 Dec 2011 16:57:53 +0000 (09:57 -0700)]
mktables: Rename variable

This is in preparation for Unicode 6.1.  The variable means LIFO, and in
6.1, a FIFO mode will also be required, so indicate that the current
variable means LIFO.

12 years agocharnames.t: Skip null name test
Karl Williamson [Tue, 27 Dec 2011 02:30:45 +0000 (19:30 -0700)]
charnames.t: Skip null name test

In versions of Unicode earlier than 6.1, there was no possibility of a
name being empty here; but 6.1 will make that happen, so guard against
it.

12 years agocharnames.t: Add test names
Karl Williamson [Tue, 27 Dec 2011 02:28:03 +0000 (19:28 -0700)]
charnames.t: Add test names

This adds test names to nearly all the ones that were missing.  Most
were done via a global substituted in a text editor.

12 years agocharnames.t: Fix test that passed whether or not it should
Karl Williamson [Tue, 27 Dec 2011 02:23:53 +0000 (19:23 -0700)]
charnames.t: Fix test that passed whether or not it should

This test was calling grep, then the comma operator, then the non-empty
string after the comment operator caused it to always succeed.

12 years agomktables: Comments only
Karl Williamson [Tue, 27 Dec 2011 00:38:44 +0000 (17:38 -0700)]
mktables: Comments only

12 years agoUnicode/UCD.t: Avoid early prototype messages
Karl Williamson [Mon, 26 Dec 2011 20:05:10 +0000 (13:05 -0700)]
Unicode/UCD.t: Avoid early prototype messages

Add an ampersand before the calls to silence these warnings

12 years agomktables: Ignore @missing lines in certain source files
Karl Williamson [Mon, 26 Dec 2011 19:45:17 +0000 (12:45 -0700)]
mktables: Ignore @missing lines in certain source files

This is in preparation for Unicode 6.1.  The release candidate version of these files
changes the syntax of this line in several of its files, so that
mktables sees them as a problem.  And, they aren't used anyway.

12 years agoperlunicode: nit
Karl Williamson [Fri, 23 Dec 2011 23:58:31 +0000 (16:58 -0700)]
perlunicode: nit

12 years agomktables: Account for 2 provisional files
Karl Williamson [Mon, 26 Dec 2011 19:17:10 +0000 (12:17 -0700)]
mktables: Account for 2 provisional files

This is in preparation for Unicode 6.1.  These two provisional
properties are available starting in 6.0, but the rest of the data base
did not refer to them, so we could safely ignore them.  But in the beta
6.1, they are referred to elsewhere, which makes mktables generate hooks
for them, and then complains when those hooks are unused.

This patch should work no matter how 6.1 final comes out, and allows
someone who really wants to use these provisional properties to
recompile Perl without having to delve too far into the mktables code to
get it to work.

12 years agomktables: Need to have two classes of unused files
Karl Williamson [Mon, 26 Dec 2011 19:08:47 +0000 (12:08 -0700)]
mktables: Need to have two classes of unused files

The current code works only when skipped files aren't actually present.
Otherwise, it deletes them from a hash, which causes a wrong warning to
be output.  By creating a separate hash for skipped files, we avoid
that.

12 years agomktables: Consistently store lc of key in hash
Karl Williamson [Mon, 26 Dec 2011 18:51:21 +0000 (11:51 -0700)]
mktables: Consistently store lc of key in hash

In most places, the keys to this hash are stored in lowercase, but not
formerly this one.  This enables not having to lc in other places.

12 years agomktables: Can skip processing suppressed properties
Karl Williamson [Mon, 26 Dec 2011 18:45:16 +0000 (11:45 -0700)]
mktables: Can skip processing suppressed properties

12 years agomktables: White-space only
Karl Williamson [Mon, 26 Dec 2011 18:21:54 +0000 (11:21 -0700)]
mktables: White-space only

To make vertically line up based on an added test

12 years agomktables: Don't test suppressed table validity
Karl Williamson [Mon, 26 Dec 2011 18:10:28 +0000 (11:10 -0700)]
mktables: Don't test suppressed table validity

This omits the test for should a table be full for suppressed tables.
Other actions in the code may or may not bypass filling them, knowing
they are suppressed.

12 years agomktables: reorder two tests
Karl Williamson [Sat, 24 Dec 2011 23:31:17 +0000 (16:31 -0700)]
mktables: reorder two tests

This simply swaps two blocks so that the fate of a table is fully
figured out before deciding if it should match everything or not.

12 years agoExpand tabs in Artistic license to spaces
Matthew Horsfall (alh) [Sun, 25 Dec 2011 16:56:02 +0000 (11:56 -0500)]
Expand tabs in Artistic license to spaces

This addresses [rt.perl.org #74046] and Debian #572245
( http://bugs.debian.org/572245 )

12 years agoAllow diag.t to pass tests for multi-line warnings.
Craig A. Berry [Thu, 29 Dec 2011 22:57:24 +0000 (16:57 -0600)]
Allow diag.t to pass tests for multi-line warnings.

It's been sending the full warning text to t/test.pl's pass()
function.  If there are newlines in the the warning, t/TEST (though
not t/harness) will spew "Unexpected output at ..." messages and
fail the test.  In this context, the warning is just a message
printed by the test infrastructure, so we might as well use the
version of the warning that's already had newlines replaced with
spaces.

12 years agoIncrease $POSIX::VERSION to 1.28
Father Chrysostomos [Thu, 29 Dec 2011 19:13:57 +0000 (11:13 -0800)]
Increase $POSIX::VERSION to 1.28

12 years agoSignal handlers must run before sigsuspend returns
Leon Timmermans [Mon, 26 Dec 2011 17:06:54 +0000 (19:06 +0200)]
Signal handlers must run before sigsuspend returns

The whole point of sigsuspend and pause is to wait until a signal has
arrived, and then return *after* it has been triggered. Currently
delayed/"safe" signals prevent that from happening, which might cause
race conditions.

This patch prevents that (as far as possible) by running the signal
handlers ASAP.

12 years agoExtUtils::ParseXS: Bump versions to 3.11
Steffen Mueller [Thu, 29 Dec 2011 16:54:37 +0000 (17:54 +0100)]
ExtUtils::ParseXS: Bump versions to 3.11

This is necessary for a CPAN release that fixes a versioning problem in
version 3.09 (CPAN RT #73555).

No functional changes.

12 years agoExport PerlIOBase_open
Leon Timmermans [Mon, 4 Jul 2011 11:05:39 +0000 (13:05 +0200)]
Export PerlIOBase_open

12 years agoperl -d: display lines inside subroutines.
Shlomi Fish [Sat, 10 Dec 2011 11:35:41 +0000 (13:35 +0200)]
perl -d: display lines inside subroutines.

This is another fix to the perl debugger while making sure that lines
inside subroutines will be printed in the run-time display of the perl
debugger: https://rt.perl.org/rt3/Ticket/Display.html?id=104820 .

12 years agoCroak when setting a tied @DB::args
Father Chrysostomos [Thu, 29 Dec 2011 07:04:04 +0000 (23:04 -0800)]
Croak when setting a tied @DB::args

In commit f8c105437 I stopped the setting of a tied @DB::args from
crashing, by untying the array.  Untying an array automatically with-
out saying anything seems a little too much like action at a distance.
For now, let’s just croak, as we can always change it later once we
decide what should happen.  At least that’s better than crashing.

12 years ago[Merge] perldiag/diag.t clean-up
Father Chrysostomos [Thu, 29 Dec 2011 07:00:57 +0000 (23:00 -0800)]
[Merge] perldiag/diag.t clean-up

This is a random sequence of a about one and a half dozen commits that
all happen to be in the same area.

At least one of these changes the wording of a message, so it should
probably go in perldelta.

12 years agoSpeed up diag.t slightly
Father Chrysostomos [Wed, 28 Dec 2011 05:40:57 +0000 (21:40 -0800)]
Speed up diag.t slightly

By using strings instead of creating qr// things that get flattened,
we can reduce the run time by 5%.

12 years agoperldiag: Delete redundant entry
Father Chrysostomos [Wed, 28 Dec 2011 05:27:00 +0000 (21:27 -0800)]
perldiag: Delete redundant entry

This was made redundant three commits ago when I added more
descriptive entries for the two variations of this message.

12 years agodiag.t: Delete documented items from to-do
Father Chrysostomos [Wed, 28 Dec 2011 02:12:20 +0000 (18:12 -0800)]
diag.t: Delete documented items from to-do

12 years agoRegen pod issues
Father Chrysostomos [Wed, 28 Dec 2011 02:11:28 +0000 (18:11 -0800)]
Regen pod issues

podcheck.t doesn’t like links with formatting codes, even though the
spec says to do it that way.

12 years agoDocument various messages in perldiag
Father Chrysostomos [Wed, 28 Dec 2011 02:04:17 +0000 (18:04 -0800)]
Document various messages in perldiag

12 years agodiag_listed_as galore
Father Chrysostomos [Tue, 27 Dec 2011 22:52:21 +0000 (14:52 -0800)]
diag_listed_as galore

In two instances, I actually modified to code to avoid %s for a
constant string, as it should be faster that way.

12 years agodiag_listed_as for -S error
Father Chrysostomos [Tue, 27 Dec 2011 20:44:43 +0000 (12:44 -0800)]
diag_listed_as for -S error

Also teach diag.t not to mistake /* die */ for a die() call, as
it did in this case, consequently ignoring the diag_listed_as,
which it thought was in the middle of the call.

12 years agodiag_listed_as for another lv sub error
Father Chrysostomos [Tue, 27 Dec 2011 18:09:01 +0000 (10:09 -0800)]
diag_listed_as for another lv sub error

12 years agodiag_listed_as for lvalue scalar context errors
Father Chrysostomos [Tue, 27 Dec 2011 18:06:44 +0000 (10:06 -0800)]
diag_listed_as for lvalue scalar context errors

12 years agoperldiag: Consistent formatting of categories
Father Chrysostomos [Tue, 27 Dec 2011 18:05:04 +0000 (10:05 -0800)]
perldiag: Consistent formatting of categories

12 years agoperldiag: Tweak pack/% message
Father Chrysostomos [Tue, 27 Dec 2011 17:57:59 +0000 (09:57 -0800)]
perldiag: Tweak pack/% message

to match the actual message perl emits.

12 years agodiag.t: perldiag does not escape %
Father Chrysostomos [Tue, 27 Dec 2011 17:56:25 +0000 (09:56 -0800)]
diag.t: perldiag does not escape %

It’s primarily for human consumption, and escaping % doesn’t avoid
ambiguities anyway, as some messages contain a literal \ followed
by a format sequence.

12 years agoDocument ‘Can't reset %ENV’ in perldiag
Father Chrysostomos [Tue, 27 Dec 2011 17:49:48 +0000 (09:49 -0800)]
Document ‘Can't reset %ENV’ in perldiag

12 years agoTeach diag.t about "CONSTANTS" in msgs
Father Chrysostomos [Tue, 27 Dec 2011 17:43:06 +0000 (09:43 -0800)]
Teach diag.t about "CONSTANTS" in msgs

After writing this code, I found that "Can't open "BIT_BUCKET"..." was
the only message affected, so I could have added an exception, but
I’ve already done this, so why not?

12 years agoperldiag: Document 2 more ‘Can't open’ messages
Father Chrysostomos [Tue, 27 Dec 2011 17:07:44 +0000 (09:07 -0800)]
perldiag: Document 2 more ‘Can't open’ messages

12 years agoperldiag: Tweak ‘Can't open perl script’
Father Chrysostomos [Tue, 27 Dec 2011 16:51:53 +0000 (08:51 -0800)]
perldiag: Tweak ‘Can't open perl script’

to match what’s in the source code more closely.

12 years agoCorrect spelling of sv_insert error msg
Father Chrysostomos [Tue, 27 Dec 2011 16:33:18 +0000 (08:33 -0800)]
Correct spelling of sv_insert error msg

It is already documented in perldiag with the right spelling.

12 years agoMore diag_listed_as
Father Chrysostomos [Tue, 27 Dec 2011 16:31:06 +0000 (08:31 -0800)]
More diag_listed_as

12 years agoperl -d: fixes "b . COND()".
Shlomi Fish [Mon, 12 Dec 2011 14:51:00 +0000 (16:51 +0200)]
perl -d: fixes "b . COND()".

break-dot for filename was broken due to previous commits. It was fixed
now. Also documented it in pod/perldebug.pod, because it was
undocumented.

12 years agoRefer to ExtUtils::ParseXS 3.09 in Maintainers.pl
Steffen Mueller [Wed, 28 Dec 2011 18:05:35 +0000 (19:05 +0100)]
Refer to ExtUtils::ParseXS 3.09 in Maintainers.pl

12 years agoEscape double-quotes in generated #line directives
Steffen Mueller [Wed, 28 Dec 2011 17:47:49 +0000 (18:47 +0100)]
Escape double-quotes in generated #line directives

 #line directives can be generated from commands. Those may be using
double quotes. That may not be considered friendly by preprocessors when
the result looks anything like this

 #line 123 "perl -e "foo""

Input on whether the following is portable would be appreciated.

 #line 123 "perl -e \"foo\""

gcc is happy with it. I know. The world's not just win32, osx, and linux
with a choice between three compilers.

12 years agopp_hot.c: diag_listed_as for method error
Father Chrysostomos [Tue, 27 Dec 2011 08:58:23 +0000 (00:58 -0800)]
pp_hot.c: diag_listed_as for method error

12 years agoperldiag: Document ‘Bizarre SvTYPE’
Father Chrysostomos [Tue, 27 Dec 2011 08:56:45 +0000 (00:56 -0800)]
perldiag: Document ‘Bizarre SvTYPE’

12 years agodiag.t: Rmv warning about "0" from to-do list
Father Chrysostomos [Tue, 27 Dec 2011 08:54:41 +0000 (00:54 -0800)]
diag.t: Rmv warning about "0" from to-do list

This was already documented, but diag.t didn’t start realising that
until commit ca53083acb.

12 years agoperldiag: Remove ‘in %s’ from bizarre copy msg
Father Chrysostomos [Tue, 27 Dec 2011 08:53:21 +0000 (00:53 -0800)]
perldiag: Remove ‘in %s’ from bizarre copy msg

so that splain can find the message even when there is no op
mentioned.

12 years agoMove diag_listed_as entry in gv.c
Father Chrysostomos [Tue, 27 Dec 2011 08:46:10 +0000 (00:46 -0800)]
Move diag_listed_as entry in gv.c

It wasn’t close enough for diag.t to see it.

12 years agoTeach diag.t that %s%s == %s
Father Chrysostomos [Tue, 27 Dec 2011 08:42:28 +0000 (00:42 -0800)]
Teach diag.t that %s%s == %s

12 years agoperldiag: Correct ‘Bad name after %s::’
Father Chrysostomos [Tue, 27 Dec 2011 08:40:30 +0000 (00:40 -0800)]
perldiag: Correct ‘Bad name after %s::’

This message can occur with either package separator (Bad name after
foo'), so having :: in the header stops splain from finding it.

12 years agoRemove item from diag.t’s to-do list
Father Chrysostomos [Tue, 27 Dec 2011 08:35:39 +0000 (00:35 -0800)]
Remove item from diag.t’s to-do list

12 years agoav.c: Consistent use of spaces after dots in apidocs
Father Chrysostomos [Tue, 27 Dec 2011 08:14:00 +0000 (00:14 -0800)]
av.c: Consistent use of spaces after dots in apidocs

12 years agoDocument the av_reify warning in perldiag
Father Chrysostomos [Tue, 27 Dec 2011 08:12:24 +0000 (00:12 -0800)]
Document the av_reify warning in perldiag

12 years agoFix compiler warning in perl.c
Father Chrysostomos [Tue, 27 Dec 2011 08:11:29 +0000 (00:11 -0800)]
Fix compiler warning in perl.c

12 years agoDon’t check for tied @DB'args when not REAL
Father Chrysostomos [Tue, 27 Dec 2011 08:11:12 +0000 (00:11 -0800)]
Don’t check for tied @DB'args when not REAL

This should make things just a smidgen faster in the most common case.

As of the previous commit, tied arrays are always AvREAL.

12 years agoTurn on AvREAL for tied arrays
Father Chrysostomos [Tue, 27 Dec 2011 08:10:05 +0000 (00:10 -0800)]
Turn on AvREAL for tied arrays

It turns out that it is possible to trigger the av_reify warning:

./perl -Ilib -lwe '
  sub TIEARRAY{bless[]}
  sub {
    tie @_, "";
    \@_;
  }->(1);
'
av_reify called on tied array at -e line 7.

12 years agoFix crash when tying @DB::args
Father Chrysostomos [Tue, 27 Dec 2011 07:46:35 +0000 (23:46 -0800)]
Fix crash when tying @DB::args

I was looking at diag.t to see what messages I could document.
‘av_reify called on tied array’ looked interesting, so I decided to
see whether I could trigger it.  I got something else:

./perl -Ilib -lwe '
  sub TIEARRAY{bless[]}
  sub CLEAR{}
  sub EXTEND{}
  tie @DB::args, "";
  package DB; sub {() = caller 0;}->(1,2,3);
'
Name "DB::args" used only once: possible typo at -e line 5.
Bus error

How exciting!

What’s happening is that Perl_init_dbargs turns off AvREAL after
clearing a real array.  Then pp_caller does av_extend and merrily
tries to copy into AvARRAY(PL_dbargs).  But AvARRAY has not been allo-
cated, because av_extend called EXTEND instead.

I fixed this by untying the array before turning off AvREAL.  I don’t
know whether that is the best fix.  Alternatives would be to croak
or to do the assignment in pp_caller differently for tied arrays (in
which case tying @DB::args would cause objects to leak unexpectedly,
until the next caller() call in the DB package).

12 years agoperlxstut: keep indentation consistent within example
Father Chrysostomos [Tue, 27 Dec 2011 06:46:22 +0000 (22:46 -0800)]
perlxstut: keep indentation consistent within example

12 years agoOnly skip updating dev.perl.org for RC releases
Dave Rolsky [Tue, 27 Dec 2011 07:05:35 +0000 (01:05 -0600)]
Only skip updating dev.perl.org for RC releases

12 years agoMake sure to close any lists in the generated checklist
Dave Rolsky [Tue, 27 Dec 2011 07:02:17 +0000 (01:02 -0600)]
Make sure to close any lists in the generated checklist

12 years ago[perl #102622] perlxstut: Add SvGETMAGIC to example
Father Chrysostomos [Tue, 27 Dec 2011 06:41:28 +0000 (22:41 -0800)]
[perl #102622] perlxstut: Add SvGETMAGIC to example

12 years agoDocument the unknown error in perldiag
Father Chrysostomos [Tue, 27 Dec 2011 06:31:04 +0000 (22:31 -0800)]
Document the unknown error in perldiag

12 years agoTeach diag.t about multiline messages
Father Chrysostomos [Tue, 27 Dec 2011 06:26:38 +0000 (22:26 -0800)]
Teach diag.t about multiline messages

A few commits ago I taught diagnostics.pm how to deal with these.
This applies things like "Attempt to reload %s aborted.\nCompilation
failed...", which is listed as two entries in perldiag.

If there is no match on a multiline message, it is treated as multi-
ple messages.  If any of those cannot be found, the whole message is
reported as a failure.

12 years agoFix up diagnostic.pm’s backtrace for multiline msgs
Father Chrysostomos [Tue, 27 Dec 2011 06:26:20 +0000 (22:26 -0800)]
Fix up diagnostic.pm’s backtrace for multiline msgs

I hope you agree this backtrace does not look very good:

$ ./perl -Ilib -Mdiagnostics -e '
  sub foo { bar () }
  sub bar { baz() }
  sub baz {
  die "Attempt to reload foo aborted.\nCompilation failed in require"} foo
'
Attempt to reload foo aborted (#1)
    (F) You tried to load a file with use or require that failed to
    compile once already.  Perl will not try to compile this file again
    unless you delete its entry from %INC.  See "require" in perlfunc and
    "%INC" in perlvar.

Compilation failed in require at -e line 1 (#2)
    (F) Perl could not compile a file specified in a require statement.
    Perl uses this generic message when none of the errors that it
    encountered were severe enough to halt compilation immediately.

Uncaught exception from user code:
Attempt to reload foo aborted.
Compilation failed in require at -e line 1.
main::baz() called at -e line 1
main::bar() called at -e line 1
main::foo() called at -e line 1

12 years agoAdd support for multiline messages to splain
Father Chrysostomos [Tue, 27 Dec 2011 04:39:19 +0000 (20:39 -0800)]
Add support for multiline messages to splain

All the ‘Compilation failed’ messages are actually multiline mes-
sages, like "Attempt to reload foo aborted.\nCompilation failed in
require at ...".

perldiag has separate entries for each line of the message, so it
makes sense to have it look up each line.  It can’t split it into
lines by default, but must check for a possible description first, as
sometimes syntax errors quote code with line breaks in it.

I had to rip out the nasty file-wide lexical $_, as I couldn’t local-
ise it, and I undid d923656e4 in the process.

12 years agodiagnostics.t: Test errors ending with dots
Father Chrysostomos [Tue, 27 Dec 2011 04:16:17 +0000 (20:16 -0800)]
diagnostics.t: Test errors ending with dots

12 years agoRemove unnecessary code from diagnostics.pm
Father Chrysostomos [Tue, 27 Dec 2011 00:56:14 +0000 (16:56 -0800)]
Remove unnecessary code from diagnostics.pm

As of commit 58618f23, it has been setting %CarpInternal, so
setting $CarpLevel is unnecessary.

12 years agoFix diagnostic.pm’s backtraces
Father Chrysostomos [Tue, 27 Dec 2011 00:55:35 +0000 (16:55 -0800)]
Fix diagnostic.pm’s backtraces

Currently a user-defined error message is printed out like this:

-----
Uncaught exception from user code:
panick:  at -e line 1.
 at -e line 1
main::baz() called at -e line 1
main::bar() called at -e line 1
main::foo() called at -e line 1
-----

Errors generated from perl itself are printed like this:

-----
panic:  at -e line 1 (#1)
    (P) An internal error.

Uncaught exception from user code:
panic:  at -e line 1.
 at -e line 1
main::baz() called at -e line 1
main::bar() called at -e line 1
main::foo() called at -e line 1
-----

By using Carp::confess(), we end up with a screwy backtrace.  Some-
times it just ends up repeating the error and line number:

-----
panic:  at -e line 1 (#1)
    (P) An internal error.

Uncaught exception from user code:
panic:  at -e line 1.
 at -e line 1
-----
Uncaught exception from user code:
panick at -e line 1.
 at -e line 1
-----

This commit cleans these up to print like this:

-----
Uncaught exception from user code:
panick:  at -e line 1.
main::baz() called at -e line 1
main::bar() called at -e line 1
main::foo() called at -e line 1
-----
panic:  at -e line 1 (#1)
    (P) An internal error.

Uncaught exception from user code:
panic:  at -e line 1.
main::baz() called at -e line 1
main::bar() called at -e line 1
main::foo() called at -e line 1
-----
panic:  at -e line 1 (#1)
    (P) An internal error.

Uncaught exception from user code:
panic:  at -e line 1.
-----
Uncaught exception from user code:
panick at -e line 1.
-----

You might ask:  Why not remove the ‘uncaught exception’ message alto-
gether after an error description.  It’s because the error description
is a diagnostic, which only prints once for each error or warning
encountered.  So you could have eval { die } somewhere else in the
code, which causes a description to be printed.  And later you have a
die() that exits the program, but nothing gets printed.

In other words, the description of the message does not replace
the error.