This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #124091] PP Data::Dumper fails on \n isolate
[perl5.git] / dist / Data-Dumper / Dumper.pm
index 0ea2e77..e884298 100644 (file)
@@ -761,7 +761,7 @@ sub qquote {
        # this.
        || (! $IS_ASCII && $] ge 5.008_001 && utf8::is_utf8($_));
 
-  return qq("$_") if / ^ [[:print:]]* $ /x;    # fast exit
+  return qq("$_") unless /[[:^print:]]/;  # fast exit if only printables
 
   # Here, there is at least one non-printable to output.  First, translate the
   # escapes.