Re: Customizable default hash and array values.
by Michael G Schwern other posts by this author
Oct 6 2001 11:48PM messages near this date
Re: Customizable default hash and array values.
|
Re: Customizable default hash and array values.
On Sun, Oct 07, 2001 at 01:26:53AM +0200, Bart Lateur wrote:
> > my $foo = $hash{foo} || 'some default';
> > my $bar = $hash{bar} || 'some other default';
>
> What about zero.
No problem in Perl 6.
my $foo = %hash{foo} // 'some default';
--
Michael G. Schwern <schwern@[...].com> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <perl-qa@[...].org> Kwalitee Is Job One
BOFH excuse #231:
We had to turn off that service to comply with the CDA Bill.
Thread:
Michael G Schwern
RaFaL Pocztarski
Johan Vromans
Bart Lateur
Michael G Schwern
Bart Lateur
Michael G Schwern
Dan Sugalski
David Grove
|