I Really, Really Want Scalar Context
- Use the scalar keyword:
@colors = qw( green orange magenta cyan ); print "I've got ", @colors, " colors!\n"; print "I've got ", scalar @colors, " colors!\n";
| CPU: Perl, Fall 2005 | Perl, Week 3: More Arrays, Context, Subroutines, Lexical Variables | #32 |
@colors = qw( green orange magenta cyan ); print "I've got ", @colors, " colors!\n"; print "I've got ", scalar @colors, " colors!\n";
| Copyright © 2005 Ian Langworth |