Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: text to array

by Utilitarian (Vicar)
on Jun 06, 2013 at 08:34 UTC ( #1037410=note: print w/replies, xml ) Need Help??

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 >

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037410]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-10-29 06:05 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (269 votes). Check out past polls.