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.
In reply to Re: oneliner cat like capability
by shmem
in thread oneliner cat like capability
by gradius85
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |