sub dump_as_str { my $str; # redirect STDERR temporarily open(my $ORIGSTDERR, ">&", STDERR) and close(STDERR) and open(STDERR, ">", \$str) or die($!); #----------------------------------------------------- #revision to suppress warnings - see bug report #63498 #----------------------------------------------------- #Dump($_[0]); { no warnings 'uninitialized'; Dump($_[0]); } # restore STDERR open(STDERR, ">&=" . fileno($ORIGSTDERR)) or die($!); return $str; }