Testing for Definedness
- Use the defined keyword:
if ( defined $meat ) { ... }
else { ... }
- Or, in Scheme:
(if (not (null? meat)) ... ...)
| CPU: Perl, Fall 2005 | Perl, Week 2: Arrays, Hashes, Control Structures | #24 |
if ( defined $meat ) { ... }
else { ... }
(if (not (null? meat)) ... ...)
| Copyright © 2005 Ian Langworth |