Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: oneliner cat like capability

by shmem (Chancellor)
on Oct 29, 2019 at 17:51 UTC ( [id://11108076]=note: print w/replies, xml ) Need Help??


in reply to oneliner cat like capability

However, it prints out each lines twice, which is in the same order as in the file. What am I doing wrong?

The -p switch implies print. See perlrun.

Invoking perl with -p and an empty script body does the trick:

perl -pe '' dataoutput.txt

In your second example, you are just printing a newline character before the implicit print is done, hence the empty lines.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found