Subject: | autoboxing not applied on function returned value within perl debugger |
My perl version is 5.26.0, Moose::Autobox 0.16.
For below script,
# foo.pl
use strict;
use warnings;
use Data::Dumper;
use Moose::Autobox;
sub f { [ 1 .. 3 ] }
print Dumper( f()->map( sub { $_ } ) );
It crashes from within a debugger,
$ perl -d foo.pl
Loading DB routines from perl5db.pl version 1.51
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
main::(foo.pl:6): print Dumper( f()->map( sub { $_ } ) );
DB<1> c
Can't call method "map" on unblessed reference at foo.pl line 6.
at foo.pl line 6.
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
It's fine without a debugger,
$ perl foo.pl
$VAR1 = [
1,
2,
3
];