... why is it important to have the 'n' or 'p' before the 'e'?
Per perlrun, the -e switch expects source text to follow, either with or without a space. The switch sequence -en means that Perl is trying to execute "n". The effect of this is made more clear with strictures enabled (see strict):
c:\@Work\Perl\monks>perl -wMstrict -en "print" foo get_bar()
Bareword "n" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
c:\@Work\Perl\monks>perl -wMstrict -ep foo get_bar()
Bareword "p" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
Update: See jwkrahn's example here of -pe1 which gives -e the source 1 (that's a digit 1) to evaluate within the source code framework established by the -p switch.
Give a man a fish: <%-{-{-{-<
| [reply] [d/l] [select] |
It's not important. You can write the loop yourself:
perl -e 'print while <>' -- dataoutput.txt
It's just helpful: if you want to iterate over the input and print always, use -p; if you want to iterate but not print, use -n; otherwise, use neither.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] [select] |