in reply to [Perl 6] Generalized shortcutting C<||>?
Assuming the func() is something complex, possibly involving $thing several times, you'll have to name $thing somehow, no matter what the syntax. Most likely $_, right? So why don't you do just that?
You can't get it much shorter without getting it way too confusing. I understand you want to get rid of the ": $_" bit, but I don't think you can nor should do that.print foo($_) ? $_ : 'undef' for fileno $fh;
|
|---|