in reply to Help choosing the most efficient, dependable condition(al)

G'day Chris,

I may be missing something here; apologies in advance if I have. I've looked at this several times and both appear to be using the same logic just written differently:

if X then Y else Z unless X then Z else Y

Is it me or you? :-)

-- Ken

Replies are listed 'Best First'.
Re^2: Help choosing the most efficient, dependable condition(al)
by taint (Chaplain) on Nov 13, 2013 at 19:19 UTC
    Greetings kcott, and thank you for taking the time to respond.

    It's me. I'm sure of it.

    Which is why I came here to ask. :)

    OTOH I've used this method for at least a couple of years now. With the exception of an occasional "Use of uninitialized value $ENV{"HTTP_ACCEPT"}...". I can't see any issue(s).

    But that doesn't mean it's correct.
    Thanks again, for taking the time to respond.

    --Chris

    #!/usr/bin/perl -Tw
    use Perl::Always or die;
    my $perl_version = (5.12.5);
    print $perl_version;

      The point I was making is that what you've "been using", and what you're considering "might be a better choice", use identical logic: the logic is written differently but both achieve the same result.

      I've looked long at the condition and TRUE/FALSE code in both but can't see any difference. It's possible I'm missing something: if not, then your not really changing anything and perhaps there's a typo in your posted code.

      -- Ken

        Greetings kcott, and thank you for the followup.

        My rationale (which might be an oxymoron) was that if I didn't have an Accept value (one wasn't provided). the unless would ensure an "always valid" -- see; defined value. No?

        I think this speaks volumes on how I think. Kinda' scary. It's so revealing. :)

        Thanks again, for taking the time to respond!

        --Chris

        #!/usr/bin/perl -Tw
        use Perl::Always or die;
        my $perl_version = (5.12.5);
        print $perl_version;