Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: oneliner cat like capabilityby shmem (Chancellor) |
on Oct 29, 2019 at 17:51 UTC ( [id://11108076]=note: print w/replies, xml ) | Need Help?? |
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:
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'
In Section
Seekers of Perl Wisdom
|
|