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."

Replies are listed 'Best First'.
Re^4: text to array
by torres09 (Acolyte) on Jun 06, 2013 at 09:29 UTC

    it does not work , stops after first line of document

      Sure, you say that, but you don't show 10 lines of file , you can use  perl -MData::Dump -MFile::Slurp -e " dd scalar read_file shift, { qw/ binmode :raw / }; "  tenlinefile > tenlinefileasperl.pl