Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: $/ usage

by graff (Chancellor)
on Jan 02, 2013 at 22:44 UTC ( #1011369=note: print w/ replies, xml ) Need Help??


in reply to Re^2: $/ usage
in thread $/ usage

To get all the lines from a slurped input file to show up as a single line on output, you want something like this:

perl -e 'undef $/; $_=<>; tr/\n/ /; s/ $/\n/; print' list
Or you could just use unix/linux commands that do the same thing:
xargs echo -n < list
(If you want a clean line break at the end of that output, add  && echo at the end.)


Comment on Re^3: $/ usage
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-03 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls