in reply to looking for a good idiom: return this if this is true

I'm not sure I understand the task, but, perhaps:  $_ = thatroutine() ? return $_ : undef;

Gyan Kapur

Replies are listed 'Best First'.
Re^2: Ternary?
by ambrus (Abbot) on Mar 05, 2005 at 19:12 UTC

    I guess you're missing a set of parens there:

    ($_ = thatroutine()) ? return $_ : undef;
Re^2: Ternary?
by Anonymous Monk on Mar 05, 2005 at 18:35 UTC
    $_ ? return $_ : undef for thatroutine(); #or simply return $_ if $_ for thatroutine();

    Gyan Kapur