We've seen a similar question earlier today. Write it like this: $optsFile = ($msgFile =~ /\-opt.dat$/) ? 1 : 0; Trinary op returns a value, as if () {} else {} does not. It is the embedded assignments that goof things up for you.
After Compline,
Zaxo
In reply to Re: ?: conditional operators appear to fail
by Zaxo
in thread ?: conditional operators appear to fail
by landau351
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |