in reply to Re: Parsing a hash table for only variables that are uppercase.
in thread Parsing a hash table for only variables that are uppercase.
Rather than checking the entire key for having uppercase letters and then negating the rest, you could check for the presence of any non-uppercase letter:
delete $runset{$_} for ( grep { /[^A-Z]/ } keys %runset );
Of course, this will also allow the null hash key as well, so you might want to extend the grep to grep { $_ && /[^A-Z]/ }, and by that point, you may have sacrificed the savings on the regex.
- Richie
|
|---|