seaver has asked for the wisdom of the Perl Monks concerning the following question:
Dear all,
I have a large hash where every key in the hash is of the format:\w\d\d, and I want to use keys to extract an array of keys that match any \d\d pattern, (hence ignoring letters) like so:
This doesnt work as it is, but is there a possible solution, or should I just step through the keys ahd store an array of the ones that match?my $r = 44; foreach my $key (keys %{$self->{'residues'}{$modelCount}{/^\w$r$/}}){ print $key."\n"; }
Cheers
Sam
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using regex to extract keys
by perlmonkey (Hermit) on Sep 24, 2003 at 20:59 UTC | |
by Abigail-II (Bishop) on Sep 24, 2003 at 21:17 UTC | |
by seaver (Pilgrim) on Sep 25, 2003 at 13:59 UTC | |
Re: Using regex to extract keys
by Mr. Muskrat (Canon) on Sep 24, 2003 at 20:59 UTC |
Back to
Seekers of Perl Wisdom