perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Improvement Data::Dumper: Print subroutine name in addition to "DUMMY"

Open KES777 opened this issue 1 month ago • 3 comments

Module: Data::Dumper

Description It is Ok that "DUMMY" is printed when we are dumping data structures:

         '646bf00c61e5511ee787937eeb977dc4' => {
                                                  'cb' => sub { "DUMMY" },
                                                  'time' => '369044.528181794',
                                                  'after' => 360000,
                                                  'recurring' => 0
                                                }
        };

Expected behavior It would be more helpful if Data::Dumper has an option to print subroutine names, Eg. "DUMMY Some::Module::sub" Or "DUMMY ANON:<file>:<line>". This will help a lot during debugging the code.

Example of a better output:

        io => {
          11 => {
            cb => sub{ "DUMMY Mojo::IOLoop::Stream::__ANON__[lib-nodebug/lib/perl5/Mojo/IOLoop/Stream.pm:62]" },
            mode => 7,
          },

KES777 avatar Oct 12 '25 18:10 KES777