Syntax error if catch clause extends to multiple lines
This:
use Nice::Try ;
try {
die 'trying' ;
}
catch (
$e where {/foo/}) {
warn "Caught foo: $e" ;
}
catch ($e) {
warn "Caught: $e" ;
}
results in a warning (note also the spellling error in the warning) and a syntax error:
Cannot have more than one falllback catch clause for block: {
warn "Caught: $e" ;
}
Bareword found where operator expected at ./try.pl line 12, near "$e where"
(Missing operator before where?)
syntax error at ./try.pl line 12, near "$e where "
Global symbol "$e" requires explicit package name (did you forget to declare "my $e"?) at ./try.pl line 13.
syntax error at ./try.pl line 16, near "} }"
Execution of ./try.pl aborted due to compilation errors.
but if the first catch block keeps the catch clause on one line:
catch ($e where {/foo/}) {
all is good.
This is Nice::Try v1.1.2