I don't Perl much, but aren't those both scalars and @foo is an array variable. $foo[0] would be a scalar that is the first element of @foo, right?