Applying pattern match (m//) to %hash will act on scalar(%hash) at foo.pl line 10. #### my %modules = %{ $Module::CoreList::version{ 5.008 } }; if( grep /cgi/i, keys %modules ) { print "Found one!\n"; }