diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-04 20:03:21 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-04 20:03:21 +0000 |
commit | 7894fbab1e479c2ce906aed9132b15a68bfa5d73 (patch) | |
tree | 6fd92293c709a77203ac960ca694d1ffdb1f5c23 /lib/dumpvar.pl | |
parent | 054b02d6604bb3beeebed2d8a040d025b131c9a6 (diff) | |
download | perl-7894fbab1e479c2ce906aed9132b15a68bfa5d73.tar.gz |
make overload, Data::Dumper, and dumpvar understand qr// stringify
overloading
p4raw-id: //depot/perl@3570
Diffstat (limited to 'lib/dumpvar.pl')
-rw-r--r-- | lib/dumpvar.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl index 32d4692d13..fb0bb2396f 100644 --- a/lib/dumpvar.pl +++ b/lib/dumpvar.pl @@ -143,6 +143,13 @@ sub unwrap { } } + if (ref $v eq 'Regexp') { + my $re = "$v"; + $re =~ s,/,\\/,g; + print "$sp-> qr/$re/\n"; + return; + } + if ( UNIVERSAL::isa($v, 'HASH') ) { @sortKeys = sort keys(%$v) ; undef $more ; |