I find myself using this method to print out Perl values all the time:
sub d {
Data::Dumper->new([])->Terse(1)->Indent(0)->Values([$_[0]])->Dump;
}
say "x = ", d($x), ' y = ', d($y);
I like this because I don't want $VAR1 =
in my output, and I rarely deal with recursive data structures.
But the thought of creating a new Data::Dumper
object and performing that long chain of initializations every time I call d()
bothers me.
Is there another stringifier I can use?