Problems? Is your data what you think it is? | |
PerlMonks |
Re: Re: Re: text string approxiamtions (concept for review)by seattlejohn (Deacon) |
on Dec 05, 2002 at 19:14 UTC ( [id://217861]=note: print w/replies, xml ) | Need Help?? |
grep and map can probably help. First, to get a subset of hash keys:
Then to get their values:
You could also get the job done using hash slices, like so:
That's more like the syntax you proposed, though I find it a bit disconcerting (maybe because I don't find the @names{...} hash-slice notation particularly natural in the first place). $perlmonks{seattlejohn} = 'John Clyman'; Update: only answered half the question in my original reply. Fixed here.
In Section
Seekers of Perl Wisdom
|
|