in reply to Array problem

The first element of @food is blank. Since $index is not defined anywhere in your script, Perl will attempt to retrieve the value for $food[0], which is an empty string, which is what you're getting.

Please consider adding use strict; to the top of your script to turn on Perl's strict variable checking. This would have caught the fact that $index is unused and might have pointed you in the right direction.