Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: oneliner cat like capability

by shmem (Chancellor)
on Oct 29, 2019 at 17:51 UTC ( #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
Node Status?
node history
Node Type: note [id://11108076]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2020-05-29 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (170 votes). Check out past polls.

    Notices?