summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-06-22 12:36:03 +0100
committerDavid Mitchell <davem@iabyn.com>2012-09-08 15:42:06 +0100
commitd3b97530399d61590a1500b52bdba553d657bda5 (patch)
tree0ad370f9d3c601b62e19d31ef7c20290098ce23d /perl.c
parent8fd1a95029bf0ff87a3064dec7d6645f40359f2c (diff)
downloadperl-d3b97530399d61590a1500b52bdba553d657bda5.tar.gz
PL_sawampersand: use 3 bit flags rather than bool
Set a separate flag for each of $`, $& and $'. It still works fine in boolean context. This will allow us to have more refined control over what parts of a match string to copy (we currently copy the whole string).
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index 8444218562..7d65719927 100644
--- a/perl.c
+++ b/perl.c
@@ -860,7 +860,7 @@ perl_destruct(pTHXx)
PL_minus_F = FALSE;
PL_doswitches = FALSE;
PL_dowarn = G_WARN_OFF;
- PL_sawampersand = FALSE; /* must save all match strings */
+ PL_sawampersand = 0; /* must save all match strings */
PL_unsafe = FALSE;
Safefree(PL_inplace);
@@ -2343,8 +2343,9 @@ STATIC void
S_run_body(pTHX_ I32 oldscope)
{
dVAR;
- DEBUG_r(PerlIO_printf(Perl_debug_log, "%s $` $& $' support.\n",
- PL_sawampersand ? "Enabling" : "Omitting"));
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "%s $` $& $' support (0x%x).\n",
+ PL_sawampersand ? "Enabling" : "Omitting",
+ (unsigned int)(PL_sawampersand)));
if (!PL_restartop) {
#ifdef PERL_MAD