This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid literal control characters in change#3039
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 28 Feb 1999 22:46:24 +0000 (22:46 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 28 Feb 1999 22:46:24 +0000 (22:46 +0000)
p4raw-link: @3039 on //depot/perl: 2b92dfceaa9d709661beb0761c3c790732df0cbc

p4raw-id: //depot/perl@3040

t/base/lex.t

index 325fd42..6bb39d0 100755 (executable)
@@ -129,11 +129,11 @@ print $foo;
   print "ok 31\n";
  
 # Does the syntax where we use the literal control character still work?
-  if ($ {\18} != 17) { print "not "  }
+  if (eval "\$ {\cX}" != 17 or $@) { print "not "  }
   print "ok 32\n";
 
-  $\ e = 24;                          # Literal control character
-  if ($\ e != 24) {  print "not "  }  # Literal control character
+  eval "\$\cN = 24";                 # Literal control character
+  if ($@ or ${"\cN"} != 24) {  print "not "  }
   print "ok 33\n";
   if ($^N != 24) {  print "not "  }  # Control character escape sequence
   print "ok 34\n";