develooper Front page | perl.perl6.language | Postings from October 2001

Re: Customizable default hash and array values.

Thread Previous | Thread Next
From:
Bart Lateur
Date:
October 6, 2001 16:27
Subject:
Re: Customizable default hash and array values.
Message ID:
mo4vrtoh52vlc99hcbf68ndrajkl88ukcg@4ax.com
On Fri, 28 Sep 2001 21:27:48 +0200, Johan Vromans wrote:

>Michael G Schwern <schwern@pobox.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 Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About