This is a live mirror of the Perl 5 development currently hosted at
12 years agoRT 43789: "in memory" files don't call STORE
David Mitchell [Wed, 5 May 2010 21:39:24 +0000 (22:39 +0100)]
RT 43789: "in memory" files don't call STORE

The code in PerlIO-scalar that implements the open $fh, '>' \$buffer
feature did not, apart from accidentally, support get/set magic and thus
tied buffers. This patch remedies that: mostly by just blindly sprinkling
SvGETMAGIC/SvSETMAGIC about, rather than doing any deep analysis and
understanding of the code. One main change I did was to add a
PerlIOScalar_read() function, rather than rely on the default behaviour
(which implements it in terms of PerlIOScalar_get_ptr() etc), since that
approach had a tendency to call FETCH multiple times

12 years agoWhen saving ints, if the value is small enough save it with the type.
Nicholas Clark [Sat, 20 Feb 2010 19:39:37 +0000 (19:39 +0000)]
When saving ints, if the value is small enough save it with the type.

This uses a new type, SAVEt_INT_SMALL.

12 years agoWhen saving I32s, if the value is small enough save it with the type.
Nicholas Clark [Sat, 20 Feb 2010 19:20:09 +0000 (19:20 +0000)]
When saving I32s, if the value is small enough save it with the type.

This uses a new type, SAVEt_I32_SMALL.

12 years agoIf we're going to introduce an @@ array, we'll want to be able to parse $#@ too
Rafael Garcia-Suarez [Fri, 22 May 2009 14:47:22 +0000 (16:47 +0200)]
If we're going to introduce an @@ array, we'll want to be able to parse $#@ too

12 years agoGive an error message if bison is not found at all
Leon Brocard [Tue, 4 May 2010 18:58:36 +0000 (19:58 +0100)]
Give an error message if bison is not found at all

12 years agoFor SAVEt_I16, save the value with the type.
Nicholas Clark [Sat, 20 Feb 2010 18:54:58 +0000 (18:54 +0000)]
For SAVEt_I16, save the value with the type.

12 years agonote in perldelta that local @tied not tied now
David Mitchell [Tue, 4 May 2010 13:43:56 +0000 (14:43 +0100)]
note in perldelta that local @tied not tied now

12 years agomake 'local $tied' untied
David Mitchell [Tue, 4 May 2010 13:37:04 +0000 (14:37 +0100)]
make 'local $tied' untied

When localising a tied scalar, don't make the scalar tied

12 years agomake local @tied, %tied, untied
David Mitchell [Tue, 4 May 2010 12:22:13 +0000 (13:22 +0100)]
make local @tied, %tied, untied

Fix for RT #7938, #7939: when localising an array or hash, don't make the
new aggregate tied.

The old behaviour of { local @tied; ... } was equivalent to:

my $saved = \@tied;
*tied = [];
tied(@tied) = tied(@$saved)  # if tied() were an lvalue function
*tied = $saved;

This patch simply removes the 'tied(@tied) = ...' step

12 years agodie() no longer propagates outside of a Safe compartment
Rafael Garcia-Suarez [Tue, 4 May 2010 13:36:47 +0000 (15:36 +0200)]
die() no longer propagates outside of a Safe compartment

so mark the test for that as a TODO. We'll decide later what behaviour
is desirable here. Note that it warns instead.

12 years agoFix parameter name for die_unwind() in embed.fnc
Rafael Garcia-Suarez [Tue, 4 May 2010 13:13:44 +0000 (15:13 +0200)]
Fix parameter name for die_unwind() in embed.fnc

12 years agoMerge remote branch 'zefram/zefram/reliable_exception' into blead
Rafael Garcia-Suarez [Tue, 4 May 2010 13:02:08 +0000 (15:02 +0200)]
Merge remote branch 'zefram/zefram/reliable_exception' into blead


12 years agoMake tests pass with open pragma in effect
Rafael Garcia-Suarez [Tue, 4 May 2010 10:22:36 +0000 (12:22 +0200)]
Make tests pass with open pragma in effect

12 years agoSilence a couple of false positive "may be used uninitialized" gcc warnings
Vincent Pit [Tue, 4 May 2010 08:43:07 +0000 (10:43 +0200)]
Silence a couple of false positive "may be used uninitialized" gcc warnings

12 years agoFor SAVEt_I8, save the value with the type.
Nicholas Clark [Sat, 20 Feb 2010 18:35:23 +0000 (18:35 +0000)]
For SAVEt_I8, save the value with the type.

12 years agofix a couple of var types
David Mitchell [Mon, 3 May 2010 22:51:34 +0000 (23:51 +0100)]
fix a couple of var types

these errors were introduced in my trie-allocation patch,

12 years agoUpdate AUTHORS/checkAUTHORS
Jesse Vincent [Mon, 3 May 2010 21:35:49 +0000 (17:35 -0400)]

12 years agoshift; optimization
Ruslan Zakirov [Mon, 3 May 2010 21:08:46 +0000 (23:08 +0200)]
shift; optimization

12 years agoFor SAVEt_BOOL, save the value with the type.
Nicholas Clark [Sat, 20 Feb 2010 17:40:04 +0000 (17:40 +0000)]
For SAVEt_BOOL, save the value with the type.

12 years agoPOD tweak to 'require' in perlfunc relating to putting Perl code in @INC
Chris Williams [Mon, 3 May 2010 18:52:34 +0000 (19:52 +0100)]
POD tweak to 'require' in perlfunc relating to putting Perl code in @INC

12 years agotweak "0x123.456" deprecation
Zefram [Fri, 30 Apr 2010 19:23:59 +0000 (20:23 +0100)]
tweak "0x123.456" deprecation

Some improvements to the deprecation added in commit

- warning message includes the word "deprecated"
- warning is in "syntax" category as well as "deprecated"
- more systematic tests
- dot detected more efficiently by incorporation into existing switch
- small doc rewording
- avoid the warning in t/op/taint.t

12 years agoReinstate some documentation about quotemeta
Rafael Garcia-Suarez [Mon, 3 May 2010 13:38:57 +0000 (15:38 +0200)]
Reinstate some documentation about quotemeta

(that was removed in 8bdbc703cb0af3faf2163ebce618944c51f180a0)

12 years agotries: don't allocate memory at runtime
David Mitchell [Mon, 3 May 2010 12:57:58 +0000 (13:57 +0100)]
tries: don't allocate memory at runtime

This is an indirect fix for
    [perl #74484] Regex causing exponential runtime+mem usage

The trie runtime code was doing more SAVETMPS than FREETMPS and was thus
growing a large tmps stack on heavy backtracking. Rather than fixing this
directly, I rewrote part of the trie code so that it no longer needs to
allocate memory in S_regmatch (it still does in find_byclass()).

The basic issue is that multiple branches in the trie may trigger an
accept state; for example:

    "abcd" =~ /xyz/abcd.*X|ab.*Y|/

here, words (branches) 2 and 3 are accept states. The original approach
was, at run time, to create a list of accepted word numbers and the
character positions of the end of each of those words. Then run the rest
of the pattern for each word in the list in turn (in word index order).
This requires memory for the list to be allocated and freed.

The new approach involves creating extra info at compile time; in
particular, for each word, a pointer to the previous accepted word (if
any) in the state tree. For example for the above pattern, part of the
state tree may be

      q    b    c    d
    1 -> 2 -> 3 -> 4 -> 5
            (#3)       (#2)

(e.g. at state 1, if the next char is 'a', we transition to state 2).
Here, state 3 is an accept state with word #3, and 5 is an accept state
with word #2. So we build a table indexed by word number, which has
wordinfo[2] = 3, wordinfo[3] = 0, thus building the word chain 2->3->0.

At run time we run the trie to completion, and remember the word
associated with the longest accept state (word #2 above). Then by following
back the chain of .prev fields, we can produce a list of all accepting
words. We then iteratively find the smallest-numbered (ie LH-most) word in
the chain, and run with it. On failure and backtrack, we find the
next-smallest and so on.

Since we are no longer recording the end-position of each word in the
string, we have to recalculate this for each backtrack. We initially
record the end-position of the shortest accepting word, and given that we
know the length of each word, we can calculate the new position each time
as an offset from that first word. Depending on unicode and folding, that
calculation can be cheap or expensive.

This algorithm is optimised for the typical case where there are a small
number (<= 2) accepting states.

This patch creates a new compile-time array, trie->wordinfo[], indexed by
word number, which contains relevant info about each word. This also
supersedes the old trie->newword[] array, whose function of recording
"overspills" of multiple words per accept state, is now handled as part of
the wordinfo[].prev chain.

12 years ago[perl #74856] Fix POD syntax in perlapi
Father Chrysostomos [Mon, 3 May 2010 12:52:01 +0000 (14:52 +0200)]
[perl #74856] Fix POD syntax in perlapi

12 years agoPlease don't use any of your git aliases in perlrepository.pod
Vincent Pit [Mon, 3 May 2010 09:59:24 +0000 (11:59 +0200)]
Please don't use any of your git aliases in perlrepository.pod

12 years agoFor SAVEt_ALLOC, store the number of save stack entries used with the type.
Nicholas Clark [Sat, 20 Feb 2010 17:19:53 +0000 (17:19 +0000)]
For SAVEt_ALLOC, store the number of save stack entries used with the type.

12 years agoPATCH: Make perluniprops.pod platform neutral
karl williamson (via RT) [Sat, 1 May 2010 16:35:34 +0000 (09:35 -0700)]
PATCH: Make perluniprops.pod platform neutral

# New Ticket Created by  karl williamson
# Please include the string:  [perl #74830]
# in the subject line of all future correspondence about this issue.
# <URL: >

This is accomplished by changing mktables which generates it

>From d114f6f25c763ecbd00d6271462e5d5c272457e7 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@khw-desktop.(none)>
Date: Sat, 1 May 2010 09:22:32 -0600
Subject: [PATCH] Add missing comma to generated pod

Signed-off-by: H.Merijn Brand <>
12 years agoFor SAVEt_REGCONTEXT, store the number of save stack entries used with the type.
Nicholas Clark [Sat, 20 Feb 2010 11:55:23 +0000 (11:55 +0000)]
For SAVEt_REGCONTEXT, store the number of save stack entries used with the type.

12 years agoPermit array assignment to steal temps and copy shared hash key scalars.
Nicholas Clark [Sun, 2 May 2010 20:04:32 +0000 (21:04 +0100)]
Permit array assignment to steal temps and copy shared hash key scalars.

Scalar assignment to array elements already does this. (As does all other
scalar assignment, and list assignment to hashes.) Prior to 4c8f17b905f2
(change 7867) list assignment to arrays did steal temps.

12 years agoBetter fix for RT #2140 (list assignment with duplicated temporaries)
Nicholas Clark [Sun, 2 May 2010 19:23:29 +0000 (20:23 +0100)]
Better fix for RT #2140 (list assignment with duplicated temporaries)

4c8f17b905f2 (change 7867) took the approach of a special case in sv_setsv()
when PL_op indicated that the current OP was OP_AASSIGN. The problem is in one
part of pp_aassign, where it was using sv_mortalcopy() on values that were
correctly marked as temporaries, but also still needed later. Hence a more
targetted solution is to avoid that call, and to instead use API calls that
will not steal temporaries.

12 years agoFix c6bf6a65 - 64 bit big endian builds were broken.
Nicholas Clark [Sun, 2 May 2010 15:19:00 +0000 (01:19 +1000)]
Fix c6bf6a65 - 64 bit big endian builds were broken.

12 years agoBump version of Carp
Rafael Garcia-Suarez [Sun, 2 May 2010 11:40:54 +0000 (13:40 +0200)]
Bump version of Carp

12 years ago[perl #74808] POD error
Gene Sullivan [Sun, 2 May 2010 11:39:54 +0000 (13:39 +0200)]
[perl #74808] POD error

The documentation incorrectly states that the $Carp::Verbose
variable makes cluck generate stack backtraces.  cluck
already generates stack backtraces.  It should say that
the variable makes croak generate stack backtraces.

12 years agoReduce Errno memory usage by around 55%.
Nicholas Clark [Sun, 2 May 2010 09:43:15 +0000 (10:43 +0100)]
Reduce Errno memory usage by around 55%.

Use Proxy Constant Subroutines rather than full-fat subroutines, and simplify
the implementation of the tied hash methods.

12 years agoRemove unused %errno and $AUTOLOAD from the generated
Nicholas Clark [Sun, 2 May 2010 08:27:09 +0000 (09:27 +0100)]
Remove unused %errno and $AUTOLOAD from the generated

12 years agoFor SVt_CLEAR, store the pad offset with the type.
Nicholas Clark [Sat, 20 Feb 2010 13:36:21 +0000 (13:36 +0000)]
For SVt_CLEAR, store the pad offset with the type.

This saves 1 slot on the save stack for each lexical encountered at run time.

12 years agoMake Term::ReadLine::findConsole fall back to STDIN if /dev/tty can't be opened
Gisle Aas [Sun, 2 May 2010 05:49:10 +0000 (22:49 -0700)]
Make Term::ReadLine::findConsole fall back to STDIN if /dev/tty can't be opened

12 years agoRemove the lexical $len and associated calculation, which is never used.
Nicholas Clark [Sat, 1 May 2010 20:34:11 +0000 (21:34 +0100)]
Remove the lexical $len and associated calculation, which is never used.

12 years agoOn the save stack, store the save type as the bottom 6 bits of a UV.
Nicholas Clark [Sat, 20 Feb 2010 12:21:52 +0000 (12:21 +0000)]
On the save stack, store the save type as the bottom 6 bits of a UV.

This makes the other 26 (or 58) bits available for save data.

12 years agoUntangle REGCP_FRAME_ELEMS from REGCP_OTHER_ELEMS.
Nicholas Clark [Sat, 20 Feb 2010 10:42:11 +0000 (10:42 +0000)]

12 years agoUpdate the Change log in Module::CoreList to include recent commits
Chris Williams [Fri, 30 Apr 2010 13:57:12 +0000 (14:57 +0100)]
Update the Change log in Module::CoreList to include recent commits

12 years agoFor threads, we ignore all files in the distribution's examples directory.
Nicholas Clark [Sat, 1 May 2010 10:51:18 +0000 (11:51 +0100)]
For threads, we ignore all files in the distribution's examples directory.

12 years agoUpgrade to IPC::Cmd 0.58
Rafael Garcia-Suarez [Fri, 30 Apr 2010 13:52:16 +0000 (15:52 +0200)]
Upgrade to IPC::Cmd 0.58

12 years agoRT#73814 - unpack() didn't handle scalar context correctly for %32H and %32u
Tony Cook [Fri, 23 Apr 2010 09:28:35 +0000 (19:28 +1000)]
RT#73814 - unpack() didn't handle scalar context correctly for %32H and %32u

split() would crash because the third item on the stack wasn't the
regular expression it expected.  unpack("%2H", ...) would return both
the unpacked result and the checksum on the stack, similarly for
unpack("%2u", ...).

12 years agoUpdate title of "Supported Platforms" in perlport to avoid
Rafael Garcia-Suarez [Fri, 30 Apr 2010 12:18:35 +0000 (14:18 +0200)]
Update title of "Supported Platforms" in perlport to avoid
breaking pod links at each perl release (spotted by Karl Williamson)

12 years agoRe-run bump-perl-version to update a few missing spots
Vincent Pit [Fri, 30 Apr 2010 10:40:08 +0000 (12:40 +0200)]
Re-run bump-perl-version to update a few missing spots

12 years agoTeach bump-perl-version about "libperl511.a"
Vincent Pit [Fri, 30 Apr 2010 10:33:08 +0000 (12:33 +0200)]
Teach bump-perl-version about "libperl511.a"

12 years agoDon't use a C++ keyword as a variable name ("new").
Nicholas Clark [Fri, 30 Apr 2010 07:12:51 +0000 (08:12 +0100)]
Don't use a C++ keyword as a variable name ("new").

12 years agoput package declaration before label in deparsing
Zefram [Thu, 29 Apr 2010 23:02:06 +0000 (00:02 +0100)]
put package declaration before label in deparsing

When deparsing a nextstate op that has both a change of package (relative
to the previous nextstate) and a label, the package declaration must be
emitted first, because it is syntactically impermissible for a label to
prefix a package declaration.

12 years agoMerge branch 'dual/Safe' into blead
Rafael Garcia-Suarez [Thu, 29 Apr 2010 20:37:06 +0000 (22:37 +0200)]
Merge branch 'dual/Safe' into blead

12 years agoBump Safe's version to 2.27 and update Changes and META.yml
Rafael Garcia-Suarez [Thu, 29 Apr 2010 20:25:36 +0000 (22:25 +0200)]
Bump Safe's version to 2.27 and update Changes and META.yml

12 years agoMention that Safe::reval() no wraps returned coderefs
Rafael Garcia-Suarez [Thu, 29 Apr 2010 15:13:42 +0000 (17:13 +0200)]
Mention that Safe::reval() no wraps returned coderefs

12 years agoDeprecate Perl_ptr_table_clear(). Nothing outside sv.c uses it.
Nicholas Clark [Thu, 29 Apr 2010 15:11:15 +0000 (16:11 +0100)]
Deprecate Perl_ptr_table_clear(). Nothing outside sv.c uses it.

Inline the necessary parts of Perl_ptr_table_clear() into Perl_ptr_table_free().
No need to reset memory to zero that is about to be freed anyway.

12 years agoRegression tests for the ptr_table_* API.
Nicholas Clark [Thu, 29 Apr 2010 14:27:31 +0000 (15:27 +0100)]
Regression tests for the ptr_table_* API.

12 years agoRevert "Un-TODO warning test"
Rafael Garcia-Suarez [Thu, 29 Apr 2010 11:02:27 +0000 (13:02 +0200)]
Revert "Un-TODO warning test"

This reverts commit efbe327085cc15510d8c261772e9ac21be3635de.

12 years agoWrap by default coderefs returned by rdo and reval
Rafael Garcia-Suarez [Thu, 29 Apr 2010 11:02:01 +0000 (13:02 +0200)]
Wrap by default coderefs returned by rdo and reval

(suggested by Tim Bunce)

12 years agoAdd &version::vxs::stringify to the default share
Rafael Garcia-Suarez [Thu, 29 Apr 2010 10:30:06 +0000 (12:30 +0200)]
Add &version::vxs::stringify to the default share

12 years agoimport Pod-Simple 3.14 for C<< >> fix
Ricardo Signes [Wed, 28 Apr 2010 03:15:04 +0000 (23:15 -0400)]
import Pod-Simple 3.14 for C<< >> fix

12 years agoCorrect POD link to perlrun.pod to be more accurate
Ævar Arnfjörð Bjarmason [Tue, 27 Apr 2010 16:35:39 +0000 (16:35 +0000)]
Correct POD link to perlrun.pod to be more accurate

Now liking to the specific section in perlrun that discusses

Signed-off-by: Ævar Arnfjörð Bjarmason <>
12 years agoAdd POD index entries for sitecustomize and
Ævar Arnfjörð Bjarmason [Tue, 27 Apr 2010 16:33:43 +0000 (16:33 +0000)]
Add POD index entries for sitecustomize and

This covers all non-perldelta occurrences of documentation that

Signed-off-by: Ævar Arnfjörð Bjarmason <>
12 years agoImprove documentation about
Philippe Bruhat (BooK) [Tue, 27 Apr 2010 16:12:36 +0000 (18:12 +0200)]
Improve documentation about

This documentation patch is more a rewording of the content of
than anything original.

The actual authors are therefore Michael G Schwern, Jan Dubois, Peter
Dintelmann, and H.Merijn Brand.

Signed-off-by: Philippe Bruhat (BooK) <>
Signed-off-by: Ævar Arnfjörð Bjarmason <>
12 years agodon't use $[ in library code
Zefram [Tue, 13 Apr 2010 21:02:58 +0000 (22:02 +0100)]
don't use $[ in library code

Remove all uses of $[, both reads and writes, from library code.
Test code (which must test behaviour of $[) is unchanged, as is the
actual implementation of $[.  Uses in CPAN libraries are also untouched:
I've opened tickets at regarding them.

12 years agoAdd miyagawa to the list of release engineering suckers.
Jesse Vincent [Tue, 27 Apr 2010 10:46:39 +0000 (18:46 +0800)]
Add miyagawa to the list of release engineering suckers.

12 years agoConvert Perl_magic_methcall() to varargs.
Nicholas Clark [Mon, 26 Apr 2010 10:52:25 +0000 (11:52 +0100)]
Convert Perl_magic_methcall() to varargs.

This means removing its macro wrapper, as there's no portable way to do varargs

12 years agoFor Perl_magic_methcall() add G_UNDEF_FILL to fill the stack with &PL_sv_undef.
Nicholas Clark [Sun, 25 Apr 2010 14:41:48 +0000 (15:41 +0100)]
For Perl_magic_methcall() add G_UNDEF_FILL to fill the stack with &PL_sv_undef.

This replaces the previous special case of using a negative argument count to
signify this, allowing the argument count to become unsigned. Rename it from n
to argc.

12 years agoFix possible undefined behaviour introduced by b9e00b79e4947c49d5520633f9efd2a8e39ec14f
Vincent Pit [Mon, 26 Apr 2010 19:51:42 +0000 (21:51 +0200)]
Fix possible undefined behaviour introduced by b9e00b79e4947c49d5520633f9efd2a8e39ec14f

12 years agoAdd a note about perlport in the release managers' guide
Rafael Garcia-Suarez [Mon, 26 Apr 2010 14:13:12 +0000 (16:13 +0200)]
Add a note about perlport in the release managers' guide

12 years agoFill blank with the release date of 5.12 in perlport
Rafael Garcia-Suarez [Mon, 26 Apr 2010 14:08:16 +0000 (16:08 +0200)]
Fill blank with the release date of 5.12 in perlport

12 years agoSave the popped cx->blk_eval.old_namesv before calling LEAVE
Vincent Pit [Sun, 25 Apr 2010 15:53:28 +0000 (17:53 +0200)]
Save the popped cx->blk_eval.old_namesv before calling LEAVE

It's fine to still refer to cx members between POPEVAL and LEAVE, but there
are a few places where the namesv is read after LEAVE happens. This is bad
because LEAVE can call arbitrary code ; in particular, it can call a destructor
that does call_sv(cv, G_EVAL), in which case the old eval context cx gets
overwritten by the new one and cx->blk_eval.old_namesv points to garbage.

12 years agoFix h2ph and test
Robin Barker [Thu, 22 Apr 2010 10:51:20 +0000 (11:51 +0100)]
Fix h2ph and test

12 years agoavoid use of operator name in macro
Robin Barker [Wed, 21 Apr 2010 23:37:34 +0000 (00:37 +0100)]
avoid use of operator name in macro

12 years agoFix Module::Build::Platform::cygwin runtime error
David Golden [Mon, 26 Apr 2010 11:46:25 +0000 (07:46 -0400)]
Fix Module::Build::Platform::cygwin runtime error

This addresses runtime errors in Module::Build::Platform::cygwin
as reported by Jesse Vincent.  The changes are backported from
the Module::Build repository and the version number has been
slightly incremented to indicate a change from the version on CPAN.

This hopefully addresses test errors in t/actions/installdeps.t, but
the error seems specific to building perl on cygwin and has not been
reported when Module::Build was tested on cygwin by CPAN Testers.

12 years agoGlobs that are in symbol table can be un-globbed
Lubomir Rintel (GoodData) [Thu, 22 Apr 2010 16:19:23 +0000 (18:19 +0200)]
Globs that are in symbol table can be un-globbed

If a symbol table entry is undefined when a glob is assigned into it, it
gets a FAKE flag which makes it possible to be downgraded when non-glob
is subsequently assigned into it. It doesn't really matter, until we
decide to localize it -- it wouldn't be possible to restore its GP upon
context return if it changed type, therefore we must not do that.

This patch turns off FAKE flag when localizing a GV and restores it when
the context is left. A test case is included.

12 years agoremove Perl_pmflag
Robin Barker [Mon, 19 Apr 2010 16:00:59 +0000 (17:00 +0100)]
remove Perl_pmflag

12 years agoregen header after last patches
Rafael Garcia-Suarez [Mon, 26 Apr 2010 08:24:43 +0000 (10:24 +0200)]
regen header after last patches

12 years agoNote in delta an incompatibility for \cX
Karl Williamson [Mon, 26 Apr 2010 08:22:42 +0000 (10:22 +0200)]
Note in delta an incompatibility for \cX

X in "\cX" must now be ASCII.  Previously, it could be anything, but led
to a malformed utf8 error if wasn't Latin1.  This construct was never
intended to be used for anything but (a subset of) ASCII.

(moved to the delta for 5.13.1)

12 years agoDeal with "\c{", and its kin
Karl Williamson [Tue, 20 Apr 2010 02:16:50 +0000 (20:16 -0600)]
Deal with "\c{", and its kin

make regen is needed

This patch forbids non-ascii following the "\c".  It also terminates for
"\c{" with a message to contact p5p if there is need for continuing its
current definition.  And if the character following the "\c" causes the
result to not be a control character, a warning is issued.  This is
currently 'deprecated', which by default is turned on.  This can easily
be changed later.

This patch is the initial patch.  It does not do any fancy showing the
context where the problematic construct occurs.  This can be added

It gathers the 3 occurrences of evaluating \c and puts them in one
common routine.

12 years agoMake sure isCNTRL and isASCII work on signed chars
Karl Williamson [Tue, 20 Apr 2010 02:05:31 +0000 (20:05 -0600)]
Make sure isCNTRL and isASCII work on signed chars

Prior to this patch, there is a potential bug in these two macros, in
which, if they are called with a signed character outside the ASCII
range, it will be negative and they always returned true for negative.
Casting the parameter to an unsigned should fix that by having it be
interpreted as a number above the ASCII range.

12 years agoMinor edition nit in perlfunc
Rafael Garcia-Suarez [Mon, 26 Apr 2010 07:44:35 +0000 (09:44 +0200)]
Minor edition nit in perlfunc

12 years agoperlebcdic.pod nits plus improve controls docs
Karl Williamson [Sat, 24 Apr 2010 20:24:25 +0000 (14:24 -0600)]
perlebcdic.pod nits plus improve controls docs

The controls all now have names, and the part about \c\ has been
corrected.  The table widths have been changed; all recipes have been
tested on the new tables.

12 years agoClarify \c in perlop.pod.
Karl Williamson [Sat, 24 Apr 2010 19:44:30 +0000 (13:44 -0600)]
Clarify \c in perlop.pod.

And structure the table containing \c better.

12 years agoEdits to perlrecharclass.pod
Karl Williamson [Sat, 24 Apr 2010 19:35:34 +0000 (13:35 -0600)]
Edits to perlrecharclass.pod

A number of clarification and wording edits have been made, fixing some
broken links, and details especially on \d in the Unicode range.  Fixed
an incorrect character ordinal

12 years agoNits in perlre.pod, x-referencing, broken links
Karl Williamson [Sat, 24 Apr 2010 18:37:19 +0000 (12:37 -0600)]
Nits in perlre.pod, x-referencing, broken links

12 years agoFix broken links
Karl Williamson [Sat, 24 Apr 2010 18:32:42 +0000 (12:32 -0600)]
Fix broken links

12 years agoperlfunc.pod: case-change cleanup; mention packtut
Karl Williamson [Sat, 24 Apr 2010 18:27:01 +0000 (12:27 -0600)]
perlfunc.pod: case-change cleanup; mention packtut

Specifies completely the behavior of the case-changing functions, and
mentions in the existence of the pack tutorial for the packing ones.

12 years agoNits in perlunicode.pod
Karl Williamson [Sat, 24 Apr 2010 18:14:27 +0000 (12:14 -0600)]
Nits in perlunicode.pod

12 years agoClarify \c usage in perlrebackslash.pod
Karl Williamson [Sat, 24 Apr 2010 17:21:24 +0000 (11:21 -0600)]
Clarify \c usage in perlrebackslash.pod

12 years agoNits in perlunifaq.pod
Karl Williamson [Sat, 24 Apr 2010 17:15:33 +0000 (11:15 -0600)]
Nits in perlunifaq.pod

12 years agoNits in perluniintro.pod
Karl Williamson [Sat, 24 Apr 2010 17:03:48 +0000 (11:03 -0600)]
Nits in perluniintro.pod

Make accurate the advice about eighth-bit set characters, and a few
editing improvements.

12 years agoRemove false statement about Unicode strings
Karl Williamson [Sat, 24 Apr 2010 16:23:08 +0000 (10:23 -0600)]
Remove false statement about Unicode strings

It is simply not true that all text strings are Unicode strings in Perl.

12 years agoDon't use Test::More in t/op/* tests
Rafael Garcia-Suarez [Mon, 26 Apr 2010 07:23:52 +0000 (09:23 +0200)]
Don't use Test::More in t/op/* tests

12 years agoadd tests for version::is_strict() and version::is_lax()
David Golden [Mon, 26 Apr 2010 00:26:44 +0000 (20:26 -0400)]
add tests for version::is_strict() and version::is_lax()

12 years agofix version::is_strict/is_lax exporting
David Golden [Sun, 25 Apr 2010 23:51:07 +0000 (19:51 -0400)]
fix version::is_strict/is_lax exporting

These were being exported with a wrapper that treated them as method
calls, which causes them to fail.  They are just functions, are
documented as such, and should never be subclassed, so this patch
just exports them directly as functions without the wrapper.

12 years agoFix utf8::is_utf8 to respect GMAGIC (e.g. $1)
gfx [Sun, 25 Apr 2010 20:02:09 +0000 (22:02 +0200)]
Fix utf8::is_utf8 to respect GMAGIC (e.g. $1)

12 years agoavoid multiple FETCHes
David Mitchell [Sun, 25 Apr 2010 15:28:41 +0000 (16:28 +0100)]
avoid multiple FETCHes

The fix 2d961f6deff7 for RT #5475 included a mechanism for the early
calling of get magic on something like


so that even though the element is used in void context, we still call
FETCH. Some people seem to rely on this.

However, the call to mg_get() didn't distinguish between a tiedelem
member retrieved from a tied array/hash, and a tiedscalar element
retrieved from a plain array/hash. In the latter case, the S_GSKIP
protection mechanism doesn't apply and a simple $foo = $h{tiedelem}
generated two calls to FETCH.

Fix this by only calling mg_get() on the element if it came from a *tied*

A side-effect of this fix is that the following no longer calls FETCH:

    my @plain_array;
    tie $plain_array[0], ....; # element 0 is now a tied scalar
    $plain_array[0]; # void context:  no longer calls FETCH.

This required one test in op/tie.t to be fixed up, but in general I think
this is a reasonable compromise.

12 years agoBump versions of charnames and Unicode::UCD after last patches
Rafael Garcia-Suarez [Sun, 25 Apr 2010 14:55:30 +0000 (16:55 +0200)]
Bump versions of charnames and Unicode::UCD after last patches

12 years agoAdapt plan after last patch
Rafael Garcia-Suarez [Sun, 25 Apr 2010 14:55:12 +0000 (16:55 +0200)]
Adapt plan after last patch

12 years agoPATCH [perl #72624] charnames::viacode(0) returns undef
Karl Williamson [Fri, 16 Apr 2010 04:12:32 +0000 (22:12 -0600)]
PATCH [perl #72624] charnames::viacode(0) returns undef

The viacode() function contained the code from the _getcode() function from
Unicode::UCD, unchanged.  However, the rest of viacode() requires that
the result be specially formatted to do a string match with leading
zeros inserted to bring the length up to 4 if less than that.  The
original function only needs to get the number right, as a numerical
comparison is done, so it doesn't do this.  This showed up with calling
viacode with 0, but the bug also affected any input that looked like a
hex number, or a U+ number, such as 'BEE' or 'U+EF'.  These need to be
massaged into '0BEE' and '00EF' for the pattern match later in the
routine to succeed.

The patch also adds a test case to Unicode::UCD to verify that it really
does work ok on 0.

12 years agoPATCH: memory leak introduced in 5.12.0
Karl Williamson [Fri, 16 Apr 2010 03:32:27 +0000 (21:32 -0600)]
PATCH: memory leak introduced in 5.12.0

There is a small possibility of a memory leak in toke.c when there is a
deprecated character in the name in a \N{...} construct, and the Perl is
embedded or something like that so that memory isn't freed up when it
exits.  This patch avoids the creation of a new scalar, and gives a
better error message besides.

12 years ago5.12.0 test failures in lib/blib.t and lib/locale.t: Darwin/PPC
James E Keenan [Sun, 25 Apr 2010 14:27:35 +0000 (16:27 +0200)]
5.12.0 test failures in lib/blib.t and lib/locale.t: Darwin/PPC