Update:Yup, as abigail suggested use each for large hashes so you dont duplicate the memory needed for the keys:my $r = 44; my $hash = $self->{'residues'}{$modelCount}; for my $key ( grep { /^\w$r$/ } keys %$hash ) { print $key."\n"; }
my $r = 44; my $hash = $self->{'residues'}{$modelCount}; while( my ($key, $value) = each %$hash ) { next if $key =~ /^\w$r$/; print $key."\n"; }
In reply to Re: Using regex to extract keys
by perlmonkey
in thread Using regex to extract keys
by seaver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |