in reply to oneliner cat like capability

As documented in perlrun, -p already prints the input, so you can just use
perl -pe "" dataoutput.txt

Or, if you want to print explicitly, use -n which loops over the input lines but doesn't print:

perl -ne 'print' dataoutput.txt

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: oneliner cat like capability
by jwkrahn (Abbot) on Oct 29, 2019 at 20:02 UTC

      ... or  -pe; (update: but see this!)


      Give a man a fish:  <%-{-{-{-<

        ... or -pe;

        Works on Windows, doesn't on POSIX-compatible shells (bash and many others). The semicolon is used by the shell, so it won't be passed to perl. POSIX: Shell Command Language:

        Sequential Lists

        Commands that are separated by a <semicolon> (';') shall be executed sequentially.

        The format for executing commands sequentially shall be:

        command1 [; command2] ...

        Each command shall be expanded and executed in the order specified.

        Running bash 4 on Linux:

        >bash --version GNU bash, version 4.3.48(1)-release (x86_64-slackware-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gp +l.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. >perl -pe; No code specified for -e. >

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^2: oneliner cat like capability
by gradius85 (Novice) on Oct 29, 2019 at 20:12 UTC

    I see what I did wrong or why it works the way I have. However, why is it important to have the 'n' or 'p' before the 'e'? Thank you for the help.

      ... 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:  <%-{-{-{-<

      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]