open(my $fg, "<", $file) or die "Could not open ’$file’\n"; @input = <$fg>; close $fg; chomp @input;#<-- add this line