in reply to Problems reading records from file

The simplest way to parse config files would be use one of the many existing config file modules on CPAN, like Config::IniFiles for instance.

Evaluating an array in a scalar context produces the number of items in the array. So your block should look like this:

unless ( @array ) { print "There is no item remaining in the file"; last; }