On Mon, Mar 31, 2003 at 02:58:12PM -0800, Michael Lazzaro wrote:
    my $x = &baz(...args...);
    return $x if $x;

I'm looking for a Perl6 way to say that oft-repeated, oft-chained two-line snippet up there without declaring the temporary variable. Using C<given> or C<when>, maybe?

$_ and return $_ given baz(...args...);


note that putting & in front of a sub call won't work in perl 6 (that syntax is used to actually refer to the right sub var itself, iirc)

--
Matthijs van Duin  --  May the Forth be with you!

Reply via email to