I can confirm this on 5.22.4 Cygwin. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if (0) { # # # millions of lines of spagetti code # # } elsif ($bad) { # my $x; #un-comment and the problem goes away confess("HERE WE ARE"); # HERE WE ARE at /tmp/t2 line 8 } HERE WE ARE at - line 7. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if ($bad - 1) { # # # millions of lines of spagetti code # # die; } elsif ($bad) { # my $x; #un-comment and the problem goes away confess("HERE WE ARE 13"); # HERE WE ARE at /tmp/t2 line 8 } HERE WE ARE 13 at - line 7. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if ($bad - 1) { # # # millions of lines of spagetti code # # die; } elsif ($bad) { my $x; #un-comment and the problem goes away confess("HERE WE ARE 13"); # HERE WE ARE at /tmp/t2 line 8 } HERE WE ARE 13 at - line 13. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if ($bad - 1) { # # # millions of lines of spagetti code # # die; } elsif ($bad) { # my $x; #un-comment and the problem goes away 1; confess("HERE WE ARE 14"); # HERE WE ARE at /tmp/t2 line 8 } HERE WE ARE 14 at - line 14. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if ($bad - 1) { # # # millions of lines of spagetti code # # die; } elsif ($bad) { # my $x; #un-comment and the problem goes away confess("HERE WE ARE 13"); # HERE WE ARE at /tmp/t2 line 8 1; } HERE WE ARE 13 at - line 13. $ perl use strict; use warnings; sub u(_) { defined($_[0]) ? $_[0] : "undef" } sub f { warn((join ", ", map{u} (caller(0))), "\n"); } use Carp; my $bad = 1; if ($bad - 1) { # # # millions of lines of spagetti code # # die; } elsif ($bad) { confess("HERE WE ARE 13"); # HERE WE ARE at /tmp/t2 line 8 } HERE WE ARE 13 at - line 7. --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=133895