develooper Front page | perl.perl5.porters | Postings from June 2003

[perl #22354] remove $*

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
June 4, 2003 14:58
Subject:
[perl #22354] remove $*
Message ID:
20030604235855.4fd7bc15.rgarciasuarez@free.fr
Ton Hospel wrote:
> Making $* lexically scoped probably already breaks pograms that still
> depend on it. So kill it, I'd say. It has been documented as deprecated
> for a long time, and gives a deprecation warning in actual code.
> Now it's also clear it causes bugs in real code.

I've verified that removing $* solves this bug (and breaks nothing
else in the core.) The most important point of the patch is pasted
below.

But I've a question :
As of 5.8.x, $* gives a deprecation warning :

  $ perl -we '$*=1'
  Use of $* is deprecated at -e line 1.

When removing a deprecated feature, should the deprecation
warning be removed as well ?


--- pp_hot.c    (revision 1474)
+++ pp_hot.c    (working copy)
@@ -1234,7 +1234,7 @@
     if (SvSCREAM(TARG))
        r_flags |= REXEC_SCREAM;
 
-    if (pm->op_pmflags & (PMf_MULTILINE|PMf_SINGLELINE)) {
+    if ((pm->op_pmflags & PMf_MULTILINE) != PL_multiline) {
        SAVEINT(PL_multiline);
        PL_multiline = pm->op_pmflags & PMf_MULTILINE;
     }
@@ -1979,7 +1979,7 @@
               ? REXEC_COPY_STR : 0;
     if (SvSCREAM(TARG))
        r_flags |= REXEC_SCREAM;
-    if (pm->op_pmflags & (PMf_MULTILINE|PMf_SINGLELINE)) {
+    if ((pm->op_pmflags & PMf_MULTILINE) != PL_multiline) {
        SAVEINT(PL_multiline);
        PL_multiline = pm->op_pmflags & PMf_MULTILINE;
     }

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About