Initial analysis:
$ gdb --args perl -Mblib rt132321.pm
(gdb) run
Starting program: /usr/bin/perl -Mblib rt132321.pm
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7fc4fa1 in parse_pre_blockend (my_perl=<optimized out>,
ctx=ctx@entry=0x7fffffffd630) at lib/Object/Pad.xs:1015
1015 PADNAMELIST *slotnames = PadlistNAMES(CvPADLIST(compclassmeta->methodscope));
(gdb) bt
#0 0x00007ffff7fc4fa1 in parse_pre_blockend (my_perl=<optimized out>,
ctx=ctx@entry=0x7fffffffd630) at lib/Object/Pad.xs:1015
#1 0x00007ffff7fbcbe6 in parse2 (hooksA=<optimized out>, hooksB=<optimized out>,
op_ptr=<optimized out>, my_perl=<optimized out>) at lib/XS/Parse/Sublike.xs:140
#2 0x00005555555ded48 in Perl_yylex (my_perl=my_perl@entry=0x5555558a92a0)
at toke.c:7205
#3 0x00005555555f49eb in Perl_yyparse (my_perl=my_perl@entry=0x5555558a92a0,
gramtype=gramtype@entry=258) at perly.c:340
#4 0x00005555555c55e1 in S_parse_body (xsinit=0x55555559c570 <xs_init>, env=0x0,
my_perl=0x5555558a92a0) at perl.c:2531
#5 perl_parse (my_perl=<optimized out>, xsinit=0x55555559c570 <xs_init>,
argc=<optimized out>, argv=<optimized out>, env=0x0) at perl.c:1822
#6 0x000055555559c3b3 in main (argc=<optimized out>, argv=<optimized out>,
env=<optimized out>) at perlmain.c:126
Probably the compclassmeta->methodscope of the outer named `method BUILD` got corrupted by the inner `method` one.
--
Paul Evans