Unequal Items
- If there are too many values, they're lopped off:
($apple, $orange) = qw( red orange blue ); # 'blue' is ignored
- If there are too few values, the variables are assigned undef:
($fish, $steak) = ('smelly');
# $steak is undef
| CPU: Perl, Fall 2005 | Perl, Week 2: Arrays, Hashes, Control Structures | #35 |
($apple, $orange) = qw( red orange blue ); # 'blue' is ignored
($fish, $steak) = ('smelly');
# $steak is undef
| Copyright © 2005 Ian Langworth |