Re: stderr?

2017-09-13 Thread ToddAndMargo

On 09/13/2017 04:57 PM, Brandon Allbery wrote:
On Wed, Sep 13, 2017 at 7:51 PM, ToddAndMargo <toddandma...@zoho.com 
<mailto:toddandma...@zoho.com>> wrote:


How do I print to STDERR?  $*ERR?

$ perl6 -e 'print $*ERR, "print to std err\n";'
print to std err

What am I doing wrong?


Use the OO form: $*ERR.print: "print to std err\n";
Unlike Perl 5, there is no special syntactic form that takes a separate 
handle.


Or use "note", which is "say" but to $*ERR.



Hi Brandon,

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

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


That was easy.  Thank you!

-T

DuckDuckGo is a pain the neck look this
stuff up.  I get 1001 hits on Perl 5!


Re: stderr?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 7:51 PM, ToddAndMargo <toddandma...@zoho.com> wrote:

> How do I print to STDERR?  $*ERR?
>
> $ perl6 -e 'print $*ERR, "print to std err\n";'
> print to std err
>
> What am I doing wrong?
>

Use the OO form: $*ERR.print: "print to std err\n";
Unlike Perl 5, there is no special syntactic form that takes a separate
handle.

Or use "note", which is "say" but to $*ERR.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen


On 02/19/2017 11:15 PM, ToddAndMargo wrote:
> On 02/19/2017 07:15 AM, Timo Paulssen wrote:
>> Oh, another question:
>>
>> please tell us how you reached that site? I expect you did a google
>> search or something; can you tell us what search terms you've used to
>> get there? We should obviously improve the docs so that they get found
>> instead of the archive …
>>
>
> https://duckduckgo.com/?q=perl6+stderr=ffab=software
>
> search term was "perl6 stderr"
>
> It is the 9th hit down (the gray one at the top is #1)
Perfect.

Yeah, that's pretty bad! We need to improve this.

Also, damn, the red box being new was absolutely not something i expected :D

  - Timo


Re: print to STDERR problem

2017-02-19 Thread Brandon Allbery
On Sun, Feb 19, 2017 at 10:14 AM, Timo Paulssen  wrote:

> Can you suggest how to improve the warnings about its obsolescence? Right
> now it says:


They wanted to use a perl 5 to perl 6 converter. They were warned that all
such had not been maintained in some time and were likely to generate
incorrect code

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen
Oh, another question:

please tell us how you reached that site? I expect you did a google
search or something; can you tell us what search terms you've used to
get there? We should obviously improve the docs so that they get found
instead of the archive …


Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen
Can you suggest how to improve the warnings about its obsolescence?
Right now it says:

>
>   This file is part of the Perl 6 Archive
>
> Note: these documents may be out of date. Do *not* use as reference!
>
> To see what is currently happening visit http://www.perl6.org/
>

And then a bit lower you can see:

>   Date: 4 Aug 2000
>   Last Modified: 14 Sep 2000

thanks
  - Timo


Re: print to STDERR problem

2017-02-18 Thread Brandon Allbery
On Sat, Feb 18, 2017 at 10:33 PM, ToddAndMargo <toddandma...@zoho.com>
wrote:

> am having issues writing to STDERR.  I am using this as
> a reference:
>https://perl6.org/archive/rfc/30.html
>
>The p52p6 translator needs to be able to spot
>instances of barewords and globs and translate them
>to scalars:
>
>print STDERR @foo;   ->   print $STDERR @foo;
>

This is obsolete; the correct variable is $*ERR.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


print to STDERR problem

2017-02-18 Thread ToddAndMargo

Hi All,

I am having issues writing to STDERR.  I am using this as
a reference:
   https://perl6.org/archive/rfc/30.html

   The p52p6 translator needs to be able to spot
   instances of barewords and globs and translate them
   to scalars:

   print STDERR @foo;   ->   print $STDERR @foo;



#!/usr/bin/perl6

use strict;
# use warnings;
# use lib;  # fill name of lib in

print $STDERR "Existing at $?LINE do to improperly used parameter\n";
exit 2;

print "This should not print\n";


$ exit.pl6
===SORRY!=== Error while compiling /home/linuxutil/perl/./exit.pl6
Variable '$STDERR' is not declared
at /home/linuxutil/perl/./exit.pl6:7
--> print ⏏$STDERR "Existing at $?LINE do to improp


What am I doing wrong?  Why isn't $STDERR declared?  Isn't
is built in?


Many thanks,
-T


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: intercept STDERR

2017-02-18 Thread Timo Paulssen
Normally it's enough to override $*ERR for this purpose. I suggest using
IO::MiddleMan to do that, or maybe IO::Capture::Simple.

HTH
  - Timo