From 4f4d7508b0c2c114e5f52420e0e87a853c5f642a Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Mon, 23 Nov 2009 17:24:25 -0800 Subject: Add s///r (non-destructive substitution). This changes s/// so that it doesn't act destructively on its target. Instead it returns the result of the substitution (or the original string if there was no match). In addition this patch: * Adds a new warning when s///r happens in void context. * Adds a error when you try to use s///r with !~ * Makes it so constant strings can be bound to s///r with =~ * Adds documentation. * Adds some tests. * Updates various debug code so it knows about the /r flag. * Adds some new 'r' words to B::Deparse. --- dump.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dump.c') diff --git a/dump.c b/dump.c index 6bfe5f4015..631f37cbb2 100644 --- a/dump.c +++ b/dump.c @@ -645,6 +645,8 @@ S_pm_description(pTHX_ const PMOP *pm) sv_catpv(desc, ",RETAINT"); if (pmflags & PMf_EVAL) sv_catpv(desc, ",EVAL"); + if (pmflags & PMf_NONDESTRUCT) + sv_catpv(desc, ",NONDESTRUCT"); return desc; } -- cgit v1.2.1