I cannot seem to get try/catch to work without Feature::Compat::Try or Syntax::Keyword::Try on perl 5.34.0, any idea what I'm doing wrong?
#!/usr/bin/env perl
use feature "try";
no experimental "try";
try {
die "woah";
} catch ($err) {
print "blah\n";
}
results in "Syntax error at ... line 8, near ) {", while this works:
use Feature::Compat::Try;
try {
die "woah";
} catch ($err) {
print "blah\n";
}
as well as this:
use Syntax::Keyword::Try;
try {
die "woah";
} catch ($err) {
print "blah\n";
}
In reply to try/catch issue by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |