in reply to ?: conditional operators appear to fail

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

Replies are listed 'Best First'.
Re^2: ?: conditional operators appear to fail
by landau351 (Initiate) on Aug 24, 2004 at 04:33 UTC
    thanx, i only just found the comments about the perlop precidence issue, i shall re-write. my code

    thanks again