Re: Customizable default hash and array values.
by Bart Lateur other posts by this author
Oct 6 2001 11:26PM messages near this date
Re: Customizable default hash and array values.
|
Re: Customizable default hash and array values.
On Fri, 28 Sep 2001 21:27:48 +0200, Johan Vromans wrote:
> Michael G Schwern <schwern@[...].com> writes:
>
> > so if $key does not exist you'll get 'some default' instead of undef.
>
> Except that a more common case is
>
> my $foo = $hash{foo} || 'some default';
> my $bar = $hash{bar} || 'some other default';
What about zero.
Oh, wait, we're back at that "??" discussion again.
--
Bart.
Thread:
Michael G Schwern
RaFaL Pocztarski
Johan Vromans
Bart Lateur
Michael G Schwern
Bart Lateur
Michael G Schwern
Dan Sugalski
David Grove
|