in reply to ?: conditional operators appear to fail

I don't see why you're not using
$optsFile = ($msgFile =~ /\-opt.dat$/) ? 1 : 0;
which is how ?: was intended to be used.