in reply to = for lists and hashes?
Any keys defined in %config will overwrite any keys in %defaults, but if the key isn't in %config the default will prevail. If I'm not mistaken this in the Perl Cookbook somewhere.#!/usr/bin/perl -w my %defaults = (name => "George", age => 26); my %config = (age => 18); my %hash = (%defaults, %config); print "$_ : $hash{$_}\n" foreach (keys %hash);
Don't know how you'd only set part of an array without setting all of it without doing something ugly and iterating through each item in each array and seeing where there's a config value and where there's a default.
Gary Blackburn
Trained Killer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: = for lists and hashes?
by skazat (Chaplain) on Mar 20, 2002 at 23:01 UTC | |
by rjray (Chaplain) on Mar 21, 2002 at 09:21 UTC |