This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't use a regexp in DB::sub().
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 9 Oct 2005 16:42:26 +0000 (16:42 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 9 Oct 2005 16:42:26 +0000 (16:42 +0000)
This should work around perlbug #37102.

p4raw-id: //depot/perl@25721

lib/DB.pm

index 342f5d8..4bc60c4 100644 (file)
--- a/lib/DB.pm
+++ b/lib/DB.pm
@@ -63,8 +63,7 @@ sub sub {
   push(@stack, $DB::single);
   $DB::single &= 1;
   $DB::single |= 4 if $#stack == $deep;
-#  print $DB::sub, "\n";
-  if ($DB::sub =~ /(?:^|::)DESTROY$/ or not defined wantarray) {
+  if ($DB::sub eq 'DESTROY' or substr($DB::sub, -9) eq '::DESTROY' or not defined wantarray) {
     &$DB::sub;
     $DB::single |= pop(@stack);
     $DB::ret = undef;