Sometimes, you may need to force scalar context where Perl is expecting a list. The fake function 'scalar' is used for this.
@rocks = qw( talc quartz jade obsidian);
print "How many rocks do you have?\n";
print "I have ", @rocks, " rocks!\n"; # WRONG, prints names of the rocks
print "I have ", scalar @rocks, " rocks!\n"; # correct, gives number of rocks