Austin Hastings wrote:

Both look horrible, of course. I'd like to rewrite them as

  if (specific_condition() :: && detail()) || general_condition()
  {
    act();
  }

so that if specific_condition() succeeded, it would cause the entire
expression to fail if detail() failed.

The use of :: comes, of course, from rexen.

Is this feasible?

Not in Perl itself. But you could always put 'em in regexen: if (/<(specific_condition())> :: <(detail())> | <(general_condition())>/) { act(); }

However that's just showing off. All you really need is:

    if ( specific_condition() ? detail() : general_condition() )
    {
       act();
    }

;-)

Damian

Reply via email to