Use of the --output flag

--00000000000055dfaf0577cb9372
Content-Type: text/plain; charset="UTF-8"

So... I'm working through some notes for a talk on Thursday and I am trying
to work out how the --output flag is supposed to work.

I would expect this to create a file called test and print "Hi\n" in it :

perl6 --output=test -e 'say "Hi"'

But instead I got Hi printed to the command line and an error :

Use of Nil in string context
  in any print at gen/moar/stage2/NQPCORE.setting line 850

Trying use it on a sime file (say "Hi") and it also doesn't do that.

(Note that the test file is created but it's empty).

Any ideas?

-- 
Simon Proctor
Cognoscite aliquid novum cotidie

http://www.khanate.co.uk/

--00000000000055dfaf0577cb9372
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>So... I&#39;m worki=
ng through some notes for a talk on Thursday and I am trying to work out ho=
w the --output flag is supposed to work.</div><div><br></div><div>I would e=
xpect this to create a file called test and print &quot;Hi\n&quot; in it :<=
/div><div><br></div><div><span style=3D"font-family:monospace,monospace">pe=
rl6 --output=3Dtest -e &#39;say &quot;Hi&quot;&#39;</span></div><div><span =
style=3D"font-family:monospace,monospace"><br></span></div><div><span style=
=3D"font-family:monospace,monospace"><font face=3D"arial,helvetica,sans-ser=
if">But instead I got Hi printed to the command line and an error :</font><=
/span></div><div><span style=3D"font-family:monospace,monospace"><font face=
=3D"arial,helvetica,sans-serif"><br></font></span></div><div><span style=3D=
"font-family:monospace,monospace">Use of Nil in string context<br>=C2=A0 in=
 any print at gen/moar/stage2/NQPCORE.setting line 850</span></div><div><br=
></div><div>Trying use it on a sime file (say &quot;Hi&quot;) and it also d=
oesn&#39;t do that.</div><div><br></div><div>(Note that the <span style=3D"=
font-family:monospace,monospace">test</span> file is created but it&#39;s e=
mpty).</div><div><br></div><div>Any ideas? <br></div><div><br>-- <br><div d=
ir=3D"ltr" class=3D"gmail_signature">Simon Proctor<br>Cognoscite aliquid no=
vum cotidie<br><br><a href=3D"http://www.khanate.co.uk/" target=3D"_blank">=
http://www.khanate.co.uk/</a></div></div></div></div></div>

--00000000000055dfaf0577cb9372--
0
simon
10/9/2018 1:18:25 PM
perl.perl6.users 1108 articles. 0 followers. Follow

4 Replies
46 Views

Similar Articles

[PageSpeed] 27

My guess is that this is a bug.

You can work around it by adding

    my $*OUT = q[test].IO.open(:w);

in front of the code.
On Tue, Oct 9, 2018 at 8:18 AM Simon Proctor <simon.proctor@gmail.com> wrote:
>
> So... I'm working through some notes for a talk on Thursday and I am trying to work out how the --output flag is supposed to work.
>
> I would expect this to create a file called test and print "Hi\n" in it :
>
> perl6 --output=test -e 'say "Hi"'
>
> But instead I got Hi printed to the command line and an error :
>
> Use of Nil in string context
>   in any print at gen/moar/stage2/NQPCORE.setting line 850
>
> Trying use it on a sime file (say "Hi") and it also doesn't do that.
>
> (Note that the test file is created but it's empty).
>
> Any ideas?
>
> --
> Simon Proctor
> Cognoscite aliquid novum cotidie
>
> http://www.khanate.co.uk/
0
b2gills
10/9/2018 1:49:19 PM
--0000000000004e15390577cc30d6
Content-Type: text/plain; charset="UTF-8"

It feels like a bug. I more wanted to know if anyone knew anything about it
for the talk.

Thanks

On Tue, 9 Oct 2018, 14:49 Brad Gilbert, <b2gills@gmail.com> wrote:

> My guess is that this is a bug.
>
> You can work around it by adding
>
>     my $*OUT = q[test].IO.open(:w);
>
> in front of the code.
> On Tue, Oct 9, 2018 at 8:18 AM Simon Proctor <simon.proctor@gmail.com>
> wrote:
> >
> > So... I'm working through some notes for a talk on Thursday and I am
> trying to work out how the --output flag is supposed to work.
> >
> > I would expect this to create a file called test and print "Hi\n" in it :
> >
> > perl6 --output=test -e 'say "Hi"'
> >
> > But instead I got Hi printed to the command line and an error :
> >
> > Use of Nil in string context
> >   in any print at gen/moar/stage2/NQPCORE.setting line 850
> >
> > Trying use it on a sime file (say "Hi") and it also doesn't do that.
> >
> > (Note that the test file is created but it's empty).
> >
> > Any ideas?
> >
> > --
> > Simon Proctor
> > Cognoscite aliquid novum cotidie
> >
> > http://www.khanate.co.uk/
>

--0000000000004e15390577cc30d6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">It feels like a bug. I more wanted to know if anyone knew=
 anything about it for the talk.<div dir=3D"auto"><br></div><div dir=3D"aut=
o">Thanks</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue=
, 9 Oct 2018, 14:49 Brad Gilbert, &lt;<a href=3D"mailto:b2gills@gmail.com">=
b2gills@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My=
 guess is that this is a bug.<br>
<br>
You can work around it by adding<br>
<br>
=C2=A0 =C2=A0 my $*OUT =3D q[test].IO.open(:w);<br>
<br>
in front of the code.<br>
On Tue, Oct 9, 2018 at 8:18 AM Simon Proctor &lt;<a href=3D"mailto:simon.pr=
octor@gmail.com" target=3D"_blank" rel=3D"noreferrer">simon.proctor@gmail.c=
om</a>&gt; wrote:<br>
&gt;<br>
&gt; So... I&#39;m working through some notes for a talk on Thursday and I =
am trying to work out how the --output flag is supposed to work.<br>
&gt;<br>
&gt; I would expect this to create a file called test and print &quot;Hi\n&=
quot; in it :<br>
&gt;<br>
&gt; perl6 --output=3Dtest -e &#39;say &quot;Hi&quot;&#39;<br>
&gt;<br>
&gt; But instead I got Hi printed to the command line and an error :<br>
&gt;<br>
&gt; Use of Nil in string context<br>
&gt;=C2=A0 =C2=A0in any print at gen/moar/stage2/NQPCORE.setting line 850<b=
r>
&gt;<br>
&gt; Trying use it on a sime file (say &quot;Hi&quot;) and it also doesn&#3=
9;t do that.<br>
&gt;<br>
&gt; (Note that the test file is created but it&#39;s empty).<br>
&gt;<br>
&gt; Any ideas?<br>
&gt;<br>
&gt; --<br>
&gt; Simon Proctor<br>
&gt; Cognoscite aliquid novum cotidie<br>
&gt;<br>
&gt; <a href=3D"http://www.khanate.co.uk/" rel=3D"noreferrer noreferrer" ta=
rget=3D"_blank">http://www.khanate.co.uk/</a><br>
</blockquote></div>

--0000000000004e15390577cc30d6--
0
simon
10/9/2018 2:02:16 PM
--------------8808FCBAB7BCB81250BC1622
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

--output is for the compiler's compilation stages

for example:

> timo@schmand ~> perl6 --output=3D/tmp/outputtest --target=3Dmbc -e 'say=
 "hi"'
> timo@schmand ~> moar --dump /tmp/outputtest | head
>
> MoarVM dump of binary compilation unit:
>
> =C2=A0 SC_0 : B1DFAD9164F11E967B354508CC458ABAB8DEDC27
> =C2=A0 SC_1 : D71FD1C8B1B40FC9B294068F2EC29C505914FDC6-0
> =C2=A0 SC_2 : 0808522FF10EC773B02A4C55883CC154BB964DE2
> =C2=A0 Callsite_0 :
> =C2=A0=C2=A0=C2=A0 num_pos: 0
> =C2=A0=C2=A0=C2=A0 arg_count: 0
> =C2=A0 Callsite_1 :


Most of the compilation stages don't work with --output, which could be
a bug. However, --output isn't supposed to change what $*OUT is set to
in the script.

Hope that helps
=C2=A0 - Timo


On 09/10/2018 15:18, Simon Proctor wrote:
> So... I'm working through some notes for a talk on Thursday and I am
> trying to work out how the --output flag is supposed to work.
>
> I would expect this to create a file called test and print "Hi\n" in it=
 :
>
> perl6 --output=3Dtest -e 'say "Hi"'
>
> But instead I got Hi printed to the command line and an error :
>
> Use of Nil in string context
> =C2=A0 in any print at gen/moar/stage2/NQPCORE.setting line 850
>
> Trying use it on a sime file (say "Hi") and it also doesn't do that.
>
> (Note that the test file is created but it's empty).
>
> Any ideas?
>
> --=20
> Simon Proctor
> Cognoscite aliquid novum cotidie
>
> http://www.khanate.co.uk/

--------------8808FCBAB7BCB81250BC1622
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body text=3D"#000000" bgcolor=3D"#FFFFFF">
    <p>--output is for the compiler's compilation stages</p>
    <p>for example:</p>
    <p>
      <blockquote type=3D"cite">timo@schmand ~&gt; perl6
        --output=3D/tmp/outputtest --target=3Dmbc -e 'say "hi"'<br>
        timo@schmand ~&gt; moar --dump /tmp/outputtest | head<br>
        <br>
        MoarVM dump of binary compilation unit:<br>
        <br>
        =C2=A0 SC_0 : B1DFAD9164F11E967B354508CC458ABAB8DEDC27<br>
        =C2=A0 SC_1 : D71FD1C8B1B40FC9B294068F2EC29C505914FDC6-0<br>
        =C2=A0 SC_2 : 0808522FF10EC773B02A4C55883CC154BB964DE2<br>
        =C2=A0 Callsite_0 :<br>
        =C2=A0=C2=A0=C2=A0 num_pos: 0<br>
        =C2=A0=C2=A0=C2=A0 arg_count: 0<br>
        =C2=A0 Callsite_1 :<br>
      </blockquote>
    </p>
    <p><br>
    </p>
    <p>Most of the compilation stages don't work with --output, which
      could be a bug. However, --output isn't supposed to change what
      $*OUT is set to in the script.</p>
    <p>Hope that helps<br>
      =C2=A0 - Timo<br>
    </p>
    <p><br>
    </p>
    <div class=3D"moz-cite-prefix">On 09/10/2018 15:18, Simon Proctor
      wrote:<br>
    </div>
    <blockquote type=3D"cite"
cite=3D"mid:CAGwa-jgBQFWos1q4PH6tVT5e5Ld9urxozaOF0yB+xOg1zukU5A@mail.gmai=
l.com">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DU=
TF-8">
      <div dir=3D"ltr">
        <div dir=3D"ltr">
          <div dir=3D"ltr">
            <div>So... I'm working through some notes for a talk on
              Thursday and I am trying to work out how the --output flag
              is supposed to work.</div>
            <div><br>
            </div>
            <div>I would expect this to create a file called test and
              print "Hi\n" in it :</div>
            <div><br>
            </div>
            <div><span style=3D"font-family:monospace,monospace">perl6
                --output=3Dtest -e 'say "Hi"'</span></div>
            <div><span style=3D"font-family:monospace,monospace"><br>
              </span></div>
            <div><span style=3D"font-family:monospace,monospace"><font
                  face=3D"arial,helvetica,sans-serif">But instead I got H=
i
                  printed to the command line and an error :</font></span=
></div>
            <div><span style=3D"font-family:monospace,monospace"><font
                  face=3D"arial,helvetica,sans-serif"><br>
                </font></span></div>
            <div><span style=3D"font-family:monospace,monospace">Use of
                Nil in string context<br>
                =C2=A0 in any print at gen/moar/stage2/NQPCORE.setting li=
ne
                850</span></div>
            <div><br>
            </div>
            <div>Trying use it on a sime file (say "Hi") and it also
              doesn't do that.</div>
            <div><br>
            </div>
            <div>(Note that the <span
                style=3D"font-family:monospace,monospace">test</span> fil=
e
              is created but it's empty).</div>
            <div><br>
            </div>
            <div>Any ideas? <br>
            </div>
            <div><br>
              -- <br>
              <div dir=3D"ltr" class=3D"gmail_signature">Simon Proctor<br=
>
                Cognoscite aliquid novum cotidie<br>
                <br>
                <a href=3D"http://www.khanate.co.uk/" target=3D"_blank"
                  moz-do-not-send=3D"true">http://www.khanate.co.uk/</a><=
/div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>

--------------8808FCBAB7BCB81250BC1622--
0
timo
10/9/2018 3:31:06 PM
--000000000000ff67fe0577cd790e
Content-Type: text/plain; charset="UTF-8"

100% thanks a lot. :)

On Tue, 9 Oct 2018 at 16:31, Timo Paulssen <timo@wakelift.de> wrote:

> --output is for the compiler's compilation stages
>
> for example:
>
> timo@schmand ~> perl6 --output=/tmp/outputtest --target=mbc -e 'say "hi"'
> timo@schmand ~> moar --dump /tmp/outputtest | head
>
> MoarVM dump of binary compilation unit:
>
>   SC_0 : B1DFAD9164F11E967B354508CC458ABAB8DEDC27
>   SC_1 : D71FD1C8B1B40FC9B294068F2EC29C505914FDC6-0
>   SC_2 : 0808522FF10EC773B02A4C55883CC154BB964DE2
>   Callsite_0 :
>     num_pos: 0
>     arg_count: 0
>   Callsite_1 :
>
>
> Most of the compilation stages don't work with --output, which could be a
> bug. However, --output isn't supposed to change what $*OUT is set to in the
> script.
>
> Hope that helps
>   - Timo
>
>
> On 09/10/2018 15:18, Simon Proctor wrote:
>
> So... I'm working through some notes for a talk on Thursday and I am
> trying to work out how the --output flag is supposed to work.
>
> I would expect this to create a file called test and print "Hi\n" in it :
>
> perl6 --output=test -e 'say "Hi"'
>
> But instead I got Hi printed to the command line and an error :
>
> Use of Nil in string context
>   in any print at gen/moar/stage2/NQPCORE.setting line 850
>
> Trying use it on a sime file (say "Hi") and it also doesn't do that.
>
> (Note that the test file is created but it's empty).
>
> Any ideas?
>
> --
> Simon Proctor
> Cognoscite aliquid novum cotidie
>
> http://www.khanate.co.uk/
>
>

-- 
Simon Proctor
Cognoscite aliquid novum cotidie

http://www.khanate.co.uk/

--000000000000ff67fe0577cd790e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">100% thanks a lot. :)<br></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr">On Tue, 9 Oct 2018 at 16:31, Timo Paulssen &lt;<a href=
=3D"mailto:timo@wakelift.de">timo@wakelift.de</a>&gt; wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
 =20
   =20
 =20
  <div text=3D"#000000" bgcolor=3D"#FFFFFF">
    <p>--output is for the compiler&#39;s compilation stages</p>
    <p>for example:</p>
    <p>
      <blockquote type=3D"cite">timo@schmand ~&gt; perl6
        --output=3D/tmp/outputtest --target=3Dmbc -e &#39;say &quot;hi&quot=
;&#39;<br>
        timo@schmand ~&gt; moar --dump /tmp/outputtest | head<br>
        <br>
        MoarVM dump of binary compilation unit:<br>
        <br>
        =C2=A0 SC_0 : B1DFAD9164F11E967B354508CC458ABAB8DEDC27<br>
        =C2=A0 SC_1 : D71FD1C8B1B40FC9B294068F2EC29C505914FDC6-0<br>
        =C2=A0 SC_2 : 0808522FF10EC773B02A4C55883CC154BB964DE2<br>
        =C2=A0 Callsite_0 :<br>
        =C2=A0=C2=A0=C2=A0 num_pos: 0<br>
        =C2=A0=C2=A0=C2=A0 arg_count: 0<br>
        =C2=A0 Callsite_1 :<br>
      </blockquote>
    </p>
    <p><br>
    </p>
    <p>Most of the compilation stages don&#39;t work with --output, which
      could be a bug. However, --output isn&#39;t supposed to change what
      $*OUT is set to in the script.</p>
    <p>Hope that helps<br>
      =C2=A0 - Timo<br>
    </p>
    <p><br>
    </p>
    <div class=3D"m_4695910504709690579moz-cite-prefix">On 09/10/2018 15:18=
, Simon Proctor
      wrote:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">
        <div dir=3D"ltr">
          <div dir=3D"ltr">
            <div>So... I&#39;m working through some notes for a talk on
              Thursday and I am trying to work out how the --output flag
              is supposed to work.</div>
            <div><br>
            </div>
            <div>I would expect this to create a file called test and
              print &quot;Hi\n&quot; in it :</div>
            <div><br>
            </div>
            <div><span style=3D"font-family:monospace,monospace">perl6
                --output=3Dtest -e &#39;say &quot;Hi&quot;&#39;</span></div=
>
            <div><span style=3D"font-family:monospace,monospace"><br>
              </span></div>
            <div><span style=3D"font-family:monospace,monospace"><font face=
=3D"arial,helvetica,sans-serif">But instead I got Hi
                  printed to the command line and an error :</font></span><=
/div>
            <div><span style=3D"font-family:monospace,monospace"><font face=
=3D"arial,helvetica,sans-serif"><br>
                </font></span></div>
            <div><span style=3D"font-family:monospace,monospace">Use of
                Nil in string context<br>
                =C2=A0 in any print at gen/moar/stage2/NQPCORE.setting line
                850</span></div>
            <div><br>
            </div>
            <div>Trying use it on a sime file (say &quot;Hi&quot;) and it a=
lso
              doesn&#39;t do that.</div>
            <div><br>
            </div>
            <div>(Note that the <span style=3D"font-family:monospace,monosp=
ace">test</span> file
              is created but it&#39;s empty).</div>
            <div><br>
            </div>
            <div>Any ideas? <br>
            </div>
            <div><br>
              -- <br>
              <div dir=3D"ltr" class=3D"m_4695910504709690579gmail_signatur=
e">Simon Proctor<br>
                Cognoscite aliquid novum cotidie<br>
                <br>
                <a href=3D"http://www.khanate.co.uk/" target=3D"_blank">htt=
p://www.khanate.co.uk/</a></div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
  </div>

</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature">Simon Proctor<br>Cognosc=
ite aliquid novum cotidie<br><br><a href=3D"http://www.khanate.co.uk/" targ=
et=3D"_blank">http://www.khanate.co.uk/</a></div>

--000000000000ff67fe0577cd790e--
0
simon
10/9/2018 3:34:30 PM
Reply: