@file = ; # you probably meant @file = ; # and then you need to chomp @file; # to remove trailing new lines