This script snippet when parsed by PPI yield unmatched braces because of the subroutine attributes in the try block:
use strict;
use warnings;
use experimental 'signatures';
use Nice::Try;
sub foo { 1 }
try {
my $k = sub ($f = foo()) {};
}
catch ($e) {
warn "caught: $e";
}
__END__
PPI gets confused and sees this as a PPI::Statement with content:
try {
my $k = sub ($f = foo()
followed by a PPI::Statement::UnmatchedBrace with value ) and then a PPI::Statement with value {}
Hello,
I am the author of Nice::Try which uses PPI (version 1.270), and I got an interesting bug report from perl monks here: https://www.perlmonks.org/?node_id=11133983
This script snippet when parsed by PPI yield unmatched braces because of the subroutine attributes in the try block:
PPI gets confused and sees this as a PPI::Statement with content:
followed by a
PPI::Statement::UnmatchedBrace
with value)
and then aPPI::Statement
with value{}