in reply to Re: Syntax for 1 line "either this or this"
in thread Syntax for 1 line "either this or this"

This looks like exactly what I remembered. Thanks so much. If it's not too imposing, however, could you explain why/how this works? OTOH, I may be able to find info on "?" and ":" as operators in Programming Perl. :-)
  • Comment on Re: Re: Syntax for 1 line "either this or this"

Replies are listed 'Best First'.
Re: Re: Re: Syntax for 1 line "either this or this"
by thelenm (Vicar) on May 29, 2003 at 23:14 UTC
    You will find information about it in the Camel book... the "?" and ":" comprise a single operator called the "ternary" or "trinary" operator, so look for that in the index. You can also find information about it in perlop. Search for "Ternary".

    -- Mike

    --
    just,my${.02}

Re: Re: Re: Syntax for 1 line "either this or this"
by BrowserUk (Patriarch) on May 29, 2003 at 23:23 UTC

    Programming Perl 3rd Ed. Section 3.16 Conditional operator.

    Or perlsyn Conditional operator.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller