On 09/15/2017 01:48 PM, Andy Bach wrote:
So "note"
$ perl6 -e 'note "hi mom"' > /dev/null
hi mom

replaces "warn ...\n" or

$ perl6 -e 'warn "hi mom\n"' > /dev/null
hi mom

   in block <unit> at -e line 1

have I forgotten my p6 newline syntax (again)?


Hi Andy,

Oh goody.  I get to help someone for once!

"note" is the same thing as "say", but to the std error:

$ perl6 -e '$*ERR.say: "print to std err";'
print to std err

$ perl6 -e 'note "print to std err";'
print to std err

$ perl6 -e 'note "print to std err";' > /dev/null
print to std err

$ perl6 -e 'note "print ", "to ", "std err";' > /dev/null 2>&1
<nothing>

"2>&1" redirects STDERR to STDOUT.  And, you put it "after"
the "/dev/null".  It is a "bash" thing.


> have I forgotten my p6 newline syntax (again)?

"\n".  It means new line.  Perl takes care of whether or
not that is a CR-LF or a LF depending on the OS involved.

example:
$ perl6 -e '$*ERR.print: "print to std err\n";'
print to std err


-T

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Serious error.
All shortcuts have disappeared.
Screen. Mind. Both are blank.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to