Exists & Delete
- Use exists to find out if an element is in the hash
$hash{foo} = undef;
if ( exists $hash{foo} ) { print "yes\n" }
continued...
| CPU: Perl, Fall 2005 | Perl, Week 4: More Arrays, Context, Subroutines, Lexical Variables | #52 |
$hash{foo} = undef;
if ( exists $hash{foo} ) { print "yes\n" }
continued...
| Copyright © 2005 Ian Langworth |