ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: Customizable default hash and array values.
by Johan Vromans other posts by this author
Sep 28 2001 7:27PM messages near this date
Re: Customizable default hash and array values. | Re: Customizable default hash and array values.
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';

-- Johan


Thread:
Michael G Schwern
RaFaL Pocztarski
Johan Vromans
Bart Lateur
Michael G Schwern
Bart Lateur
Michael G Schwern
Dan Sugalski
David Grove

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved