-require 5.002; # For (defined ref)
+require 5.014; # For more reliable $@ after eval
package dumpvar;
# Needed for PrettyPrinter only:
}
sub stringify {
+ my $string;
+ if (eval { $string = _stringify(@_); 1 }) {
+ return $string;
+ }
+
+ return "<< value could not be dumped: $@ >>";
+}
+
+sub _stringify {
(my $__, local $noticks) = @_;
for ($__) {
local($v) ;
$sp = " " x $s ;
$s += 3 ;
+ eval {
# Check for reused addresses
if (ref $v) {
my $val = $v;
print( (' ' x $s) . "FileHandle({$v}) => fileno($fileno)\n" );
}
}
+ };
+ if ($@) {
+ print( (' ' x $s) . "<< value could not be dumped: $@ >>\n");
+ }
+
+ return;
}
sub matchlex {