The expression @quantity = [2,1] does not
assign two values into the array, it instead assigns an
anonymous array reference which contains two values into
the array. Did you mean @quantity = (2,1) instead?
Here is some more code to play with:
my @wrong = [2,1];
my @right = (2,1);
my $ref = [2,1];
print 'right: ', Dumper \@right;
print 'right: ', Dumper $ref;
print 'wrong: ', Dumper \@wrong;
Yes, I did mean to type (2,1). I'm having a colorless day.
I did enjoy your triplet paradiddle with high-hat. Fortunately being a guitar player, I only have to tap my foot, hold a single note and raise my pick hand in the air. (Hey I was an 80's rocker -> gimme a break).