[Israel.pm] Golf

Mikhael Goikhman migo at homemail.com
Wed Nov 2 14:24:00 PST 2005


On 02 Nov 2005 23:52:37 +0200, Gaal Yahas wrote:
> 
> 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 $answer = ask("yourself") // ask("friend") // ask("mother");
> >   $answer //= ask("mailing list") // 42;
> 
> my $answer = [//] map { ask $_ } <yourself friend mother>;

In this case, this is not shorter and less readable.

Better find whether it is possible to insert "mailing list" into qw()
in Perl 6 (something that seems impossible in Perl 5), and if not,
implement some escaping ASAP. :)

Regards,
Mikhael.

-- 
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'



More information about the Perl mailing list