Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: read file into 1 line string

by tommyxd (Acolyte)
on Apr 21, 2012 at 12:13 UTC ( [id://966345]=note: print w/replies, xml ) Need Help??


in reply to read file into 1 line string

You can try doing something like this:
#!/usr/bin/perl -w use strict; my @data = ("something", "else\n", "and", "again\n", "hi"); my $result; for (@data) { chomp; $result .= $_ . " "; } print $result;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found