[Israel.pm] Golf
Gaal Yahas
gaal at forum2.org
Wed Nov 2 13:52:37 PST 2005
On Wed, Nov 02, 2005 at 09:47:33PM +0000, Mikhael Goikhman wrote:
> Perl 6 (and 5.10, I think) will have a shortcut for this:
>
> my $done = what(0) // "etwas";
>
> that should work like "||" or "or", but it preserves 0 and "" values.
>
> my $answer = ask("yourself") // ask("friend") // ask("mother");
> $answer //= ask("mailing list") // 42;
my $answer = [//] map { ask $_ } <yourself friend mother>;
--
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
More information about the Perl
mailing list