in reply to Perl copy Text from file to Script

You have dropped the association before making your request. untie @file; should be called after you no longer need the @file array to be associated with the file

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."