http://www.perlmonks.org?node_id=1037410


in reply to Re^2: text to array
in thread text to array

If your words are tab separated, the following should work
#!/usr/local/bin/perl use strict; use warnings; open (my $wordfile, '<', 'test1234.txt')|| die "Could not open test123 +4.txt, $!"; while (<$wordfile>){ print join ',', split(/\t/, $_); exit; }
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."