Dervish has asked for the wisdom of the Perl Monks concerning the following question:

I have a code snippet that's generating odd errors. Can you tell what I've done wrong?
print "$tmpf\n"; # prints 'farms' print keys( %factories); # 'farms' is one of them. if ( defined $factories{ $tmpf})
This seems to do what I want, but it also generates the error message 'Use of uninitialized value in pattern match (m//)'