The key to understanding this sort of problem is that you get an extra item in the output. It's not too important what that item is.
In general, the first thing you'd want to do when your container variable has more (or less) in it than you expect is to look at it's contents. The Data::Dumper module comes with Perl and can pretty print data structures for you:
use Data::Dumper;
print Dumper( \@foo );
Once you see what is in your container, you can start to work backward to find out how it got in there. You'd eventually end up noticing that right after you initialized @foo that it already had one element, which isn't what you wanted.
Another trick is to check the number of elements in the list:
print "There are " . @array . " elements in \@array\n";
If you get a number you don't expect, work backward to find out when the extra element showed up.