KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm wondering if Perl has a built-in way to check for the existence of a hash element with a key matching a particular regex. For example: my %h = ( 'twelve' => 12, 'thirteen' => 13, 'fourteen' => 14 ); I'm wondering if there is any way to do this: print "We have 12\n" if exists $h{twelve}; print "We have some teens\n" if exists $h{/.*teen$/};
Tags (comma-separated)
Save Edits
Cancel