Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

On 06/12/2018 05:47 PM, Timo Paulssen wrote:

My recommendations:

     if $line.contains(all("wine-patched/archive/staging-/", ".tar.gz")){ }

     # if the path has to be at the beginning and the extension at the end,
     # which your original regex doesn't require, but it's probably right
     if $line.starts-with("wine-patched/archive/staging-/") &&
$line.ends-with(".tar.gz") { }

     if $line ~~ m{ "wine-patched/archive/staging-/" .* ".tar.gz" } { }

What do you think?
   - Timo



I like it.

I used

$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line 
~~ m| "wine-patched/archive/staging-/" .*? ".tar.gz" |  {say "yes"} else 
{say "no"};'

yes

as it insures the patterns are in sequence, not random.

Thank you!


Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

On 06/12/2018 05:26 PM, Brandon Allbery wrote:

No, you are stuck with

     $foo ~~ m|xxx| && $foo ~~ m|yyy|

or

     $foo ~~ m|xxx .* yyy|



Ah cool.  And it insures that they are "in a row"
now anywhere in the string, as with the double "if"

$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line 
~~ m| "wine-patched/archive/staging-/" .*? ".tar.gz" |  {say "yes"} else 
{say "no"};'


yes

Thank you!


Re: need second pair of eyes

2018-06-12 Thread Timo Paulssen
My recommendations:

    if $line.contains(all("wine-patched/archive/staging-/", ".tar.gz")){ }

    # if the path has to be at the beginning and the extension at the end,
    # which your original regex doesn't require, but it's probably right
    if $line.starts-with("wine-patched/archive/staging-/") &&
$line.ends-with(".tar.gz") { }

    if $line ~~ m{ "wine-patched/archive/staging-/" .* ".tar.gz" } { }

What do you think?
  - Timo


Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
No, you are stuck with

$foo ~~ m|xxx| && $foo ~~ m|yyy|

or

$foo ~~ m|xxx .* yyy|

(the latter assuming they always happen in that order; if they don't, you
can only use the first.)

On Tue, Jun 12, 2018 at 8:25 PM ToddAndMargo  wrote:

> On 06/12/2018 05:19 PM, Brandon Allbery wrote:
> > You're trying to do it all in one regex. That doesn't work; what you
> > tried will attempt to test that the same *substring* of the regex
> > matches both of those, which is not possible because they're both
> > literal. So any given substring has to be one, the other, or neither, it
> > can't simultaneously be both.
>
> So I am stuck with using "/"
>
> Thank you for the help.
>
> -T
>


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


Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

On 06/12/2018 05:19 PM, Brandon Allbery wrote:
You're trying to do it all in one regex. That doesn't work; what you 
tried will attempt to test that the same *substring* of the regex 
matches both of those, which is not possible because they're both 
literal. So any given substring has to be one, the other, or neither, it 
can't simultaneously be both.


So I am stuck with using "/"

Thank you for the help.

-T


Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
You're trying to do it all in one regex. That doesn't work; what you tried
will attempt to test that the same *substring* of the regex matches both of
those, which is not possible because they're both literal. So any given
substring has to be one, the other, or neither, it can't simultaneously be
both.

Either use two different matches, or put something like  .*  in between
instead of trying to use & or &&.

On Tue, Jun 12, 2018 at 8:15 PM ToddAndMargo  wrote:

>  >
>  > On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo   > > wrote:
>  >
>  > On 06/12/2018 03:41 PM, ToddAndMargo wrote:
>  >  > Hi Alk,
>  >  >
>  >  > What am I dong wrong here?
>  >  >
>  >  >
>  >  > $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if
>  > $Line
>  >  > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say
>  > "yes"}
>  >  > else {say "no};'
>  >  >
>  >  > ===SORRY!===
>  >  > Expression needs parens to avoid gobbling block
>  >  > at -e:1
>  >  > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
>  >  > Missing block (apparently claimed by expression)
>  >  > at -e:1
>  >  > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
>  >  >
>  >  >
>  >  > :'(
>  >  >
>  >  > -T
>  >
>  >
>  > This fixed it:
>  >
>  > $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if
> $Line
>  > ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say
>  > "yes"}
>  > else {say "no"};'
>  >
>  >
>  > How do I use "|" instead of "/"?  I am trying to rid myself of the
>  > /\/\//\//\\/\/  tree
>  > On 06/12/2018 04:37 PM, Brandon Allbery wrote:
> > Same as in perl 5:  m ... 
> >
> > m|xxx|
>
> so I have to include the m
>
> Doesn't work
>
>
> $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line
> ~~ m| "wine-patched\/archive\/staging\-\/"  &  ".tar.gz" |  {say "yes"}
> else {say "no"};'
> no
>
>
> :'(
>


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


Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

>
> On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo  > wrote:
>
> On 06/12/2018 03:41 PM, ToddAndMargo wrote:
>  > Hi Alk,
>  >
>  > What am I dong wrong here?
>  >
>  >
>  > $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if
> $Line
>  > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say
> "yes"}
>  > else {say "no};'
>  >
>  > ===SORRY!===
>  > Expression needs parens to avoid gobbling block
>  > at -e:1
>  > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
>  > Missing block (apparently claimed by expression)
>  > at -e:1
>  > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
>  >
>  >
>  > :'(
>  >
>  > -T
>
>
> This fixed it:
>
> $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if 
$Line

> ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say
> "yes"}
> else {say "no"};'
>
>
> How do I use "|" instead of "/"?  I am trying to rid myself of the
> /\/\//\//\\/\/  tree
> On 06/12/2018 04:37 PM, Brandon Allbery wrote:

Same as in perl 5:  m ... 

m|xxx|


so I have to include the m

Doesn't work


$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line 
~~ m| "wine-patched\/archive\/staging\-\/"  &  ".tar.gz" |  {say "yes"} 
else {say "no"};'

no


:'(


Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
Same as in perl 5:  m ... 

m|xxx|


On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo  wrote:

> On 06/12/2018 03:41 PM, ToddAndMargo wrote:
> > Hi Alk,
> >
> > What am I dong wrong here?
> >
> >
> > $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if $Line
> > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"}
> > else {say "no};'
> >
> > ===SORRY!===
> > Expression needs parens to avoid gobbling block
> > at -e:1
> > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
> > Missing block (apparently claimed by expression)
> > at -e:1
> > --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
> >
> >
> > :'(
> >
> > -T
>
>
> This fixed it:
>
> $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line
> ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say "yes"}
> else {say "no"};'
>
>
> How do I use "|" instead of "/"?  I am trying to rid myself of the
> /\/\//\//\\/\/  tree
>


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


Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

On 06/12/2018 03:41 PM, ToddAndMargo wrote:

Hi Alk,

What am I dong wrong here?


$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if $Line 
~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"} 
else {say "no};'


===SORRY!===
Expression needs parens to avoid gobbling block
at -e:1
--> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
Missing block (apparently claimed by expression)
at -e:1
--> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};


:'(

-T



This fixed it:

$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz";if $Line 
~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say "yes"} 
else {say "no"};'



How do I use "|" instead of "/"?  I am trying to rid myself of the
/\/\//\//\\/\/  tree


Re: need second pair of eyes

2018-06-12 Thread ToddAndMargo

On 06/12/2018 03:46 PM, Brandon Allbery wrote:

if $Line~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |



If
 wine-patched/archive/staging-/
AND
 .tar.gz

both exist in $Line, then TRUE

how do I clean this up?


Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
I don't expect

  if $Line ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |

does what you expect. In fact, I'm not sure what you expect there; those
|-s are going to be taken as slip prefix operators, and the second one
indeed will gobble the following block as the expression it applies to.

On Tue, Jun 12, 2018 at 6:42 PM ToddAndMargo  wrote:

> Hi Alk,
>
> What am I dong wrong here?
>
>
> $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if $Line
> ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"}
> else {say "no};'
>
> ===SORRY!===
> Expression needs parens to avoid gobbling block
> at -e:1
> --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
> Missing block (apparently claimed by expression)
> at -e:1
> --> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
>
>
> :'(
>
> -T
>


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


need second pair of eyes

2018-06-12 Thread ToddAndMargo

Hi Alk,

What am I dong wrong here?


$ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if $Line 
~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"} 
else {say "no};'


===SORRY!===
Expression needs parens to avoid gobbling block
at -e:1
--> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
Missing block (apparently claimed by expression)
at -e:1
--> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};


:'(

-T


Re: need second pair of eyes

2018-06-04 Thread ToddAndMargo

On 06/03/2018 03:15 PM, Thomas Klausner wrote:

Hi!

On Sun, Jun 03, 2018 at 03:05:33PM -0700, ToddAndMargo wrote:

On 06/03/2018 02:54 PM, Brad Gilbert wrote:



But in this case it is even better to use -I and -M

  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
   RunNoShell::RunNoShell("ls *.pm6"); say $a;'


$ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls
\*.pm6"); say $a;'


You forgot
   -e

to tell p6 to eval the following string

Greetings,
domm




Thank you


Re: need second pair of eyes

2018-06-04 Thread Thomas Klausner
Hi!

On Sun, Jun 03, 2018 at 03:05:33PM -0700, ToddAndMargo wrote:
> On 06/03/2018 02:54 PM, Brad Gilbert wrote:

> > But in this case it is even better to use -I and -M
> > 
> >  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
> >   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> 
> $ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls
> \*.pm6"); say $a;'

You forgot
  -e

to tell p6 to eval the following string

Greetings,
domm

-- 
#!/usr/bin/perl  http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

Hi Brandon,

  I really appreciate all the help you have given me on this!


Hi All,

  As it transpired, I can not do

 use module.pm6 < xxx yyy >;

as it is not yet implemented.  Brandon had to suss it
out for me.

https://rt.perl.org/Public/Bug/Display.html?id=127305

-T


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
"use" does two things, in both perl 5 and perl 6. It loads definitions from
a file, and it imports things marked as exported.
(The first can be done separately, the same way in both: "require" instead
of "use".)

Normally you will give a file its own namespace with a "module" (perl 5:
"package") declaration; in this case, you usually want to import
subsequently, which is why "use" combines the two steps. But you can leave
off the module declaration in the file you loaded, in which case it loads
into the current module and you do not need to import anything because you
loaded directly into your current namespace instead. "Import" means you are
requesting things in a different namespace to be made available directly in
yours.

The thing before (the last, if there are multiple) "::"s is the namespace.
There is a default namespace, which is where your program will be if you do
not specify otherwise. Most, but as I said above not all, modules load into
their own namespaces so as to not collide with existing names from other
modules; then you can use imports to control which names are brought into
your namespace.

If you want a name from another namespace, provided it is declared "our",
you can use the explicit namespace with the double colons.

(Perl 5 defaults all subs to "our". Perl 6 defaults them to "my": you have
no choice but to mark these as "is export" and import them, if they are to
be visible from outside the file they are in. If your perl 5 is older, you
cannot make a "my" sub.)

On Sun, Jun 3, 2018 at 10:49 PM ToddAndMargo  wrote:

> On 06/03/2018 06:02 PM, Brandon Allbery wrote:
> > t doesn't affect export at all. It affects what namespace the original
> > name is in. Why would it affect export or import directly?
> >
> > Although if they end up declared in your existing namespace because you
> > didn't include it so it loaded the file in your current namespace, then
> > no export or import is needed. (Which, again, is the same as with Perl
> 5.)
>
> When I say "import" I am referring to "use ".  Did I trip
> across a reserved word in Perl 6?
>
> Also. You told me the why again, not the ramifications.
> Would you mind answer both of the questions?
>
> I especially would like to know if
>  use RunNoShell < RunNoShell RunNoShellErr >;
> works or how to get it to work
>
> Thank you for all the help with this!
>
> -T
>


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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 06:02 PM, Brandon Allbery wrote:
t doesn't affect export at all. It affects what namespace the original 
name is in. Why would it affect export or import directly?


Although if they end up declared in your existing namespace because you 
didn't include it so it loaded the file in your current namespace, then 
no export or import is needed. (Which, again, is the same as with Perl 5.)


When I say "import" I am referring to "use ".  Did I trip
across a reserved word in Perl 6?

Also. You told me the why again, not the ramifications.
Would you mind answer both of the questions?

I especially would like to know if
use RunNoShell < RunNoShell RunNoShellErr >;
works or how to get it to work

Thank you for all the help with this!

-T


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
It doesn't affect export at all. It affects what namespace the original
name is in. Why would it affect export or import directly?

Although if they end up declared in your existing namespace because you
didn't include it so it loaded the file in your current namespace, then no
export or import is needed. (Which, again, is the same as with Perl 5.)

On Sun, Jun 3, 2018 at 8:58 PM ToddAndMargo  wrote:

> >> On Sun, Jun 3, 2018 at 7:40 PM ToddAndMargo  >> > wrote:
> >>
> >>  >> On Sun, Jun 3, 2018 at 7:17 PM ToddAndMargo
> >> mailto:toddandma...@zoho.com>
> >>  >> >>
> >> wrote:
> >>  >>
> >>  >>
> >>  >> On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo
> >>  >> mailto:toddandma...@zoho.com>
> >> >
> >>  >>  >>  >>   >>  >>  >> wrote:
> >>  >>  >>
> >>  >>  >> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
> >>  >>  >>  > It is allowed if you have 'unit module
> >> RunNoShell;' at
> >>  >> the top of
> >>  >>  >>  > RunNoShell.pm6. Otherwise you defined it in the
> main
> >>  >> namespace and
> >>  >>  >>  > looking for it in the RunNoShell namespace will
> fail.
> >>  >>  >>  >
> >>  >>  >>  > Perl 5 does the same thing fi you omitted
> 'package
> >>  >> RunNoShell;'
> >>  >>  >> at the
> >>  >>  >>  > top of RunNoShell.pm.
> >>  >>  >>  >
> >>  >>  >>
> >>  >>  >> The name of the file is `RunNoShell.pm`
> >>  >>  >>
> >>  >>  >> It has two exported subs:
> >>  >>  >>sub RunNoShellErr ( $RunString ) is export
> >>  >>  >>sub RunNoShell ( $RunString ) is export
> >>  >>  >>
> >>  >>  >> If I place
> >>  >>  >>unit module RunNoShell;
> >>  >>  >>
> >>  >>  >> at the top, what happens?
> >>  >>  >>   All subs get exported?
> >>  >>  >>   Do I have to import them differently
> >>  >>  >>
> >>  >>  >>
> >>  >>  >> What happens is your two subs get the full names
> >>  >>  >>
> >>  >>  >>  RunNoShell::RunNoShellErr
> >>  >>  >>  RunNoShell::RunNoShell
> >>  >>  >>
> >>  >>  >> Without those lines, their full names are
> >>  >>  >>
> >>  >>  >>  MAIN::RunNoShellErr
> >>  >>  >>  MAIN::RunNoShell
> >>  >>
> >>  >> 6/03/2018 03:54 PM, Brandon Allbery wrote:
> >>  >>  >
> >>  >>  > Since you are explicitly running RunNoShell::RunNoShell,
> >> you get an
> >>  >>  > error with the second because there is no sub by that
> name.
> >>  >>  >
> >>  >>  > Again, this is no different from Perl 5 if you forget to
> >> include
> >>  >>  > 'package RunNoShell;' And this matters only in the case
> >> where you
> >>  >>  > explicitly asked for RunNoShell::RunNoShell instead of
> just
> >>  >> RunNoShell,
> >>  >>  > which importing handles for you.
> >>  >>
> >>  >>
> >>  >> My main reason for wanting to know this is for maintaining
> my
> >>  >> code.
> >>  >>
> >>  >> In Perl 5
> >>  >>   use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );
> >>  >>
> >>  >> I can do a simple search to figure our where the heck
> >>  >> (may not be my "actual" word) `BOLD` came from.
> >>  >>
> >>  >> If I want to doubly make sure I know where things came from,
> >>  >> I can write
> >>  >> Term::ASNIColor::BOLD
> >>  >>
> >>  >> I have no such option in Perl 6 to do this.  This is the
> ONLY
> >>  >> thing I like better in p5 that is better than p6.  (Perl 5's
> >>  >> sub declarations are a nightmare.)
> >>  >>
> >>  >> So I am looking for a substitute way of doing this.  So
> >>  >> back to my original question:
> >>  >>
> >>  >>
> >>  >> The name of the file is `RunNoShell.pm`
> >>  >>
> >>  >> It has two exported subs:
> >>  >>sub RunNoShellErr ( $RunString ) is export
> >>  >>sub RunNoShell ( $RunString ) is export
> >>  >>
> >>  >> If I place
> >>  >>unit module RunNoShell;
> >>  >>
> >>  >> at the top, what happens?
> >>  >>   All subs get exported?
> >>  >>   Do I have to import them differently
> >>  >>
> >>  >>  Old way:
> >>  >>  use RunNoShell;  # qx[ RunNoShell ];

Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo
On Sun, Jun 3, 2018 at 7:40 PM ToddAndMargo > wrote:


 >> On Sun, Jun 3, 2018 at 7:17 PM ToddAndMargo
mailto:toddandma...@zoho.com>
 >> >>
wrote:
 >>
 >>
 >> On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo
 >> mailto:toddandma...@zoho.com>
>
 >>  >>  > wrote:
 >>  >>
 >>  >> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
 >>  >>  > It is allowed if you have 'unit module
RunNoShell;' at
 >> the top of
 >>  >>  > RunNoShell.pm6. Otherwise you defined it in the main
 >> namespace and
 >>  >>  > looking for it in the RunNoShell namespace will fail.
 >>  >>  >
 >>  >>  > Perl 5 does the same thing fi you omitted 'package
 >> RunNoShell;'
 >>  >> at the
 >>  >>  > top of RunNoShell.pm.
 >>  >>  >
 >>  >>
 >>  >> The name of the file is `RunNoShell.pm`
 >>  >>
 >>  >> It has two exported subs:
 >>  >>sub RunNoShellErr ( $RunString ) is export
 >>  >>sub RunNoShell ( $RunString ) is export
 >>  >>
 >>  >> If I place
 >>  >>unit module RunNoShell;
 >>  >>
 >>  >> at the top, what happens?
 >>  >>   All subs get exported?
 >>  >>   Do I have to import them differently
 >>  >>
 >>  >>
 >>  >> What happens is your two subs get the full names
 >>  >>
 >>  >>  RunNoShell::RunNoShellErr
 >>  >>  RunNoShell::RunNoShell
 >>  >>
 >>  >> Without those lines, their full names are
 >>  >>
 >>  >>  MAIN::RunNoShellErr
 >>  >>  MAIN::RunNoShell
 >>
 >> 6/03/2018 03:54 PM, Brandon Allbery wrote:
 >>  >
 >>  > Since you are explicitly running RunNoShell::RunNoShell,
you get an
 >>  > error with the second because there is no sub by that name.
 >>  >
 >>  > Again, this is no different from Perl 5 if you forget to
include
 >>  > 'package RunNoShell;' And this matters only in the case
where you
 >>  > explicitly asked for RunNoShell::RunNoShell instead of just
 >> RunNoShell,
 >>  > which importing handles for you.
 >>
 >>
 >> My main reason for wanting to know this is for maintaining my
 >> code.
 >>
 >> In Perl 5
 >>   use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );
 >>
 >> I can do a simple search to figure our where the heck
 >> (may not be my "actual" word) `BOLD` came from.
 >>
 >> If I want to doubly make sure I know where things came from,
 >> I can write
 >> Term::ASNIColor::BOLD
 >>
 >> I have no such option in Perl 6 to do this.  This is the ONLY
 >> thing I like better in p5 that is better than p6.  (Perl 5's
 >> sub declarations are a nightmare.)
 >>
 >> So I am looking for a substitute way of doing this.  So
 >> back to my original question:
 >>
 >>
 >> The name of the file is `RunNoShell.pm`
 >>
 >> It has two exported subs:
 >>sub RunNoShellErr ( $RunString ) is export
 >>sub RunNoShell ( $RunString ) is export
 >>
 >> If I place
 >>unit module RunNoShell;
 >>
 >> at the top, what happens?
 >>   All subs get exported?
 >>   Do I have to import them differently
 >>
 >>  Old way:
 >>  use RunNoShell;  # qx[ RunNoShell ];

On 06/03/2018 04:22 PM, Brandon Allbery wrote:
 > You have misunderstood. The reason you can do that in Perl 5 is
because
 > Term/ANSIColor.pm starts with
 >
 >  package Term::ANSIColor;
 >
 > It has nothing to do with what you named the file, it is a matter of
 > namespaces. And Perl 5 and Perl 6 behave mostly the same here
(Perl 6
 > has a few more options). Neither one will create a new namespace
just
 > because you stuck something in a different file; you must in both
cases
 > specify the namespace ("package: in Perl 5, "unit module" in Perl 6).
 >

Not sure why you did not answer my question.  Maybe I am just confused.


On 06/03/2018 04:45 PM, Brandon Allbery wrote:
The question you asked was why putting sub RunInTerm in RunInTerm.pm6 
did not declare a name RunInTerm::RunInTerm, it only declared a name 
RunInTerm. You even provided a specific example of 

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
The question you asked was why putting sub RunInTerm in RunInTerm.pm6 did
not declare a name RunInTerm::RunInTerm, it only declared a name RunInTerm.
You even provided a specific example of this question.

If you had a different question in mind, try asking it again.

On Sun, Jun 3, 2018 at 7:40 PM ToddAndMargo  wrote:

> >> On Sun, Jun 3, 2018 at 7:17 PM ToddAndMargo  >> > wrote:
> >>
> >>
> >> On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo
> >> mailto:toddandma...@zoho.com>
> >>  >> >>
> >> wrote:
> >>  >>
> >>  >> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
> >>  >>  > It is allowed if you have 'unit module RunNoShell;' at
> >> the top of
> >>  >>  > RunNoShell.pm6. Otherwise you defined it in the main
> >> namespace and
> >>  >>  > looking for it in the RunNoShell namespace will fail.
> >>  >>  >
> >>  >>  > Perl 5 does the same thing fi you omitted 'package
> >> RunNoShell;'
> >>  >> at the
> >>  >>  > top of RunNoShell.pm.
> >>  >>  >
> >>  >>
> >>  >> The name of the file is `RunNoShell.pm`
> >>  >>
> >>  >> It has two exported subs:
> >>  >>sub RunNoShellErr ( $RunString ) is export
> >>  >>sub RunNoShell ( $RunString ) is export
> >>  >>
> >>  >> If I place
> >>  >>unit module RunNoShell;
> >>  >>
> >>  >> at the top, what happens?
> >>  >>   All subs get exported?
> >>  >>   Do I have to import them differently
> >>  >>
> >>  >>
> >>  >> What happens is your two subs get the full names
> >>  >>
> >>  >>  RunNoShell::RunNoShellErr
> >>  >>  RunNoShell::RunNoShell
> >>  >>
> >>  >> Without those lines, their full names are
> >>  >>
> >>  >>  MAIN::RunNoShellErr
> >>  >>  MAIN::RunNoShell
> >>
> >> 6/03/2018 03:54 PM, Brandon Allbery wrote:
> >>  >
> >>  > Since you are explicitly running RunNoShell::RunNoShell, you get
> an
> >>  > error with the second because there is no sub by that name.
> >>  >
> >>  > Again, this is no different from Perl 5 if you forget to include
> >>  > 'package RunNoShell;' And this matters only in the case where you
> >>  > explicitly asked for RunNoShell::RunNoShell instead of just
> >> RunNoShell,
> >>  > which importing handles for you.
> >>
> >>
> >> My main reason for wanting to know this is for maintaining my
> >> code.
> >>
> >> In Perl 5
> >>   use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );
> >>
> >> I can do a simple search to figure our where the heck
> >> (may not be my "actual" word) `BOLD` came from.
> >>
> >> If I want to doubly make sure I know where things came from,
> >> I can write
> >> Term::ASNIColor::BOLD
> >>
> >> I have no such option in Perl 6 to do this.  This is the ONLY
> >> thing I like better in p5 that is better than p6.  (Perl 5's
> >> sub declarations are a nightmare.)
> >>
> >> So I am looking for a substitute way of doing this.  So
> >> back to my original question:
> >>
> >>
> >> The name of the file is `RunNoShell.pm`
> >>
> >> It has two exported subs:
> >>sub RunNoShellErr ( $RunString ) is export
> >>sub RunNoShell ( $RunString ) is export
> >>
> >> If I place
> >>unit module RunNoShell;
> >>
> >> at the top, what happens?
> >>   All subs get exported?
> >>   Do I have to import them differently
> >>
> >>  Old way:
> >>  use RunNoShell;  # qx[ RunNoShell ];
>
> On 06/03/2018 04:22 PM, Brandon Allbery wrote:
> > You have misunderstood. The reason you can do that in Perl 5 is because
> > Term/ANSIColor.pm starts with
> >
> >  package Term::ANSIColor;
> >
> > It has nothing to do with what you named the file, it is a matter of
> > namespaces. And Perl 5 and Perl 6 behave mostly the same here (Perl 6
> > has a few more options). Neither one will create a new namespace just
> > because you stuck something in a different file; you must in both cases
> > specify the namespace ("package: in Perl 5, "unit module" in Perl 6).
> >
>
> Not sure why you did not answer my question.  Maybe I am just confused.
>


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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 04:21 PM, Patrick Spek via perl6-users wrote:

No problem!

To be precise, -e can be easily remembered from "evaluate" (which I
think is also what it actually stands for).


Great tip.  Thank you!

Chuckle,  I was thinking "-e" mean "execute",  Funny
because Perl6 is not a complied code.  Well not "right
away".

:-)


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo
On Sun, Jun 3, 2018 at 7:17 PM ToddAndMargo > wrote:



On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo
mailto:toddandma...@zoho.com>
 >> >>
wrote:
 >>
 >> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
 >>  > It is allowed if you have 'unit module RunNoShell;' at
the top of
 >>  > RunNoShell.pm6. Otherwise you defined it in the main
namespace and
 >>  > looking for it in the RunNoShell namespace will fail.
 >>  >
 >>  > Perl 5 does the same thing fi you omitted 'package
RunNoShell;'
 >> at the
 >>  > top of RunNoShell.pm.
 >>  >
 >>
 >> The name of the file is `RunNoShell.pm`
 >>
 >> It has two exported subs:
 >>sub RunNoShellErr ( $RunString ) is export
 >>sub RunNoShell ( $RunString ) is export
 >>
 >> If I place
 >>unit module RunNoShell;
 >>
 >> at the top, what happens?
 >>   All subs get exported?
 >>   Do I have to import them differently
 >>
 >>
 >> What happens is your two subs get the full names
 >>
 >>  RunNoShell::RunNoShellErr
 >>  RunNoShell::RunNoShell
 >>
 >> Without those lines, their full names are
 >>
 >>  MAIN::RunNoShellErr
 >>  MAIN::RunNoShell

6/03/2018 03:54 PM, Brandon Allbery wrote:
 >
 > Since you are explicitly running RunNoShell::RunNoShell, you get an
 > error with the second because there is no sub by that name.
 >
 > Again, this is no different from Perl 5 if you forget to include
 > 'package RunNoShell;' And this matters only in the case where you
 > explicitly asked for RunNoShell::RunNoShell instead of just
RunNoShell,
 > which importing handles for you.


My main reason for wanting to know this is for maintaining my
code.

In Perl 5
  use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );

I can do a simple search to figure our where the heck
(may not be my "actual" word) `BOLD` came from.

If I want to doubly make sure I know where things came from,
I can write
Term::ASNIColor::BOLD

I have no such option in Perl 6 to do this.  This is the ONLY
thing I like better in p5 that is better than p6.  (Perl 5's
sub declarations are a nightmare.)

So I am looking for a substitute way of doing this.  So
back to my original question:


The name of the file is `RunNoShell.pm`

It has two exported subs:
   sub RunNoShellErr ( $RunString ) is export
   sub RunNoShell ( $RunString ) is export

If I place
   unit module RunNoShell;

at the top, what happens?
  All subs get exported?
  Do I have to import them differently

 Old way:
 use RunNoShell;  # qx[ RunNoShell ];


On 06/03/2018 04:22 PM, Brandon Allbery wrote:
You have misunderstood. The reason you can do that in Perl 5 is because 
Term/ANSIColor.pm starts with


     package Term::ANSIColor;

It has nothing to do with what you named the file, it is a matter of 
namespaces. And Perl 5 and Perl 6 behave mostly the same here (Perl 6 
has a few more options). Neither one will create a new namespace just 
because you stuck something in a different file; you must in both cases 
specify the namespace ("package: in Perl 5, "unit module" in Perl 6).




Not sure why you did not answer my question.  Maybe I am just confused.


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
You have misunderstood. The reason you can do that in Perl 5 is because
Term/ANSIColor.pm starts with

package Term::ANSIColor;

It has nothing to do with what you named the file, it is a matter of
namespaces. And Perl 5 and Perl 6 behave mostly the same here (Perl 6 has a
few more options). Neither one will create a new namespace just because you
stuck something in a different file; you must in both cases specify the
namespace ("package: in Perl 5, "unit module" in Perl 6).

On Sun, Jun 3, 2018 at 7:17 PM ToddAndMargo  wrote:

>
> On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo  >> > wrote:
> >>
> >> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
> >>  > It is allowed if you have 'unit module RunNoShell;' at the top of
> >>  > RunNoShell.pm6. Otherwise you defined it in the main namespace
> and
> >>  > looking for it in the RunNoShell namespace will fail.
> >>  >
> >>  > Perl 5 does the same thing fi you omitted 'package RunNoShell;'
> >> at the
> >>  > top of RunNoShell.pm.
> >>  >
> >>
> >> The name of the file is `RunNoShell.pm`
> >>
> >> It has two exported subs:
> >>sub RunNoShellErr ( $RunString ) is export
> >>sub RunNoShell ( $RunString ) is export
> >>
> >> If I place
> >>unit module RunNoShell;
> >>
> >> at the top, what happens?
> >>   All subs get exported?
> >>   Do I have to import them differently
> >>
> >>
> >> What happens is your two subs get the full names
> >>
> >>  RunNoShell::RunNoShellErr
> >>  RunNoShell::RunNoShell
> >>
> >> Without those lines, their full names are
> >>
> >>  MAIN::RunNoShellErr
> >>  MAIN::RunNoShell
>
> 6/03/2018 03:54 PM, Brandon Allbery wrote:
> >
> > Since you are explicitly running RunNoShell::RunNoShell, you get an
> > error with the second because there is no sub by that name.
> >
> > Again, this is no different from Perl 5 if you forget to include
> > 'package RunNoShell;' And this matters only in the case where you
> > explicitly asked for RunNoShell::RunNoShell instead of just RunNoShell,
> > which importing handles for you.
>
>
> My main reason for wanting to know this is for maintaining my
> code.
>
> In Perl 5
>  use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );
>
> I can do a simple search to figure our where the heck
> (may not be my "actual" word) `BOLD` came from.
>
> If I want to doubly make sure I know where things came from,
> I can write
>Term::ASNIColor::BOLD
>
> I have no such option in Perl 6 to do this.  This is the ONLY
> thing I like better in p5 that is better than p6.  (Perl 5's
> sub declarations are a nightmare.)
>
> So I am looking for a substitute way of doing this.  So
> back to my original question:
>
>
> The name of the file is `RunNoShell.pm`
>
> It has two exported subs:
>   sub RunNoShellErr ( $RunString ) is export
>   sub RunNoShell ( $RunString ) is export
>
> If I place
>   unit module RunNoShell;
>
> at the top, what happens?
>  All subs get exported?
>  Do I have to import them differently
>
> Old way:
> use RunNoShell;  # qx[ RunNoShell ];
>


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


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

No problem!

To be precise, -e can be easily remembered from "evaluate" (which I
think is also what it actually stands for).

On Sun, 3 Jun 2018 16:08:04 -0700
ToddAndMargo  wrote:

> On 06/03/2018 03:57 PM, Patrick Spek via perl6-users wrote:
> > It's not that it particularly dislikes it, but you have to think
> > about it in what the options do, and what you want to accomplish.
> > 
> > In a regular Perl 6 script, you'd also have to consider the order in
> > which you do a similar thing. First, you need to make sure the
> > include paths are correct, so the module can be found. Then, you
> > have to `use` the module, so that you can access the subs and
> > classes it exports. Finally, you want to let it run some piece of
> > code that gets you where you want to go.
> > 
> > This is what -I, -M and -e do, respectively, when ran as a one-liner
> > from the shell.  
> 
> Makes total sense.  -e means go do something.
> 
> My goof up was my alias
> 
> $ alias p6
> alias p6='perl6 -e'
> 
> I had to write the thing out.
> 
> I mainly use one liners to test out syntax, especially
> regex's before stitching them into my programs.
> 
> And, now that I have your recommendations written down,
> I should not forget them again.
> 
> Thank you for the help!

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUd+gACgkQN/W6H45X
OE/SaQf/Rvll52ckA+KRmpH6E0YHKarxDSQA6xeSnWHVpIh3r3FgQUvLX8FZEgcv
3mOsNNrglACC2+w9jO78zN/TCMFiInr0CAWyebgLLH0JbhLzyereZx6CtDfV17Qt
StsSAzAHK51DAFkqOwJILkZ0aMIk/ooqaXzeAU4SWP3oeBBg0DpzdWRDvh9/t1S7
UTX0AzMraR0P1cx8Y1h6lCyohHL1ynqjxNsq9Ut1OvTFXatwZZBoQpYEK/GkKQRn
AOWMNjiPv5PqPleAZrYQJv18toqbGAfRPHyt8wmMh79IXljPJZogohVheWUFa78R
UlugiKqSOJPVkJBsWrozuR+5CXbKXA==
=t7Ue
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo



On 0>> On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo 
> wrote:

On 06/03/2018 03:24 PM, Brandon Allbery wrote:
 > It is allowed if you have 'unit module RunNoShell;' at the top of
 > RunNoShell.pm6. Otherwise you defined it in the main namespace and
 > looking for it in the RunNoShell namespace will fail.
 >
 > Perl 5 does the same thing fi you omitted 'package RunNoShell;'
at the
 > top of RunNoShell.pm.
 >

The name of the file is `RunNoShell.pm`

It has two exported subs:
   sub RunNoShellErr ( $RunString ) is export
   sub RunNoShell ( $RunString ) is export

If I place
   unit module RunNoShell;

at the top, what happens?
  All subs get exported?
  Do I have to import them differently


What happens is your two subs get the full names

 RunNoShell::RunNoShellErr
 RunNoShell::RunNoShell

Without those lines, their full names are

 MAIN::RunNoShellErr
 MAIN::RunNoShell


6/03/2018 03:54 PM, Brandon Allbery wrote:


Since you are explicitly running RunNoShell::RunNoShell, you get an 
error with the second because there is no sub by that name.


Again, this is no different from Perl 5 if you forget to include 
'package RunNoShell;' And this matters only in the case where you 
explicitly asked for RunNoShell::RunNoShell instead of just RunNoShell, 
which importing handles for you.



My main reason for wanting to know this is for maintaining my
code.

In Perl 5
use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );

I can do a simple search to figure our where the heck
(may not be my "actual" word) `BOLD` came from.

If I want to doubly make sure I know where things came from,
I can write
  Term::ASNIColor::BOLD

I have no such option in Perl 6 to do this.  This is the ONLY
thing I like better in p5 that is better than p6.  (Perl 5's
sub declarations are a nightmare.)

So I am looking for a substitute way of doing this.  So
back to my original question:


The name of the file is `RunNoShell.pm`

It has two exported subs:
 sub RunNoShellErr ( $RunString ) is export
 sub RunNoShell ( $RunString ) is export

If I place
 unit module RunNoShell;

at the top, what happens?
All subs get exported?
Do I have to import them differently

   Old way:
   use RunNoShell;  # qx[ RunNoShell ];


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 03:57 PM, Patrick Spek via perl6-users wrote:

It's not that it particularly dislikes it, but you have to think about
it in what the options do, and what you want to accomplish.

In a regular Perl 6 script, you'd also have to consider the order in
which you do a similar thing. First, you need to make sure the include
paths are correct, so the module can be found. Then, you have to `use`
the module, so that you can access the subs and classes it exports.
Finally, you want to let it run some piece of code that gets you where
you want to go.

This is what -I, -M and -e do, respectively, when ran as a one-liner
from the shell.


Makes total sense.  -e means go do something.

My goof up was my alias

   $ alias p6
   alias p6='perl6 -e'

I had to write the thing out.

I mainly use one liners to test out syntax, especially
regex's before stitching them into my programs.

And, now that I have your recommendations written down,
I should not forget them again.

Thank you for the help!


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It's not that it particularly dislikes it, but you have to think about
it in what the options do, and what you want to accomplish.

In a regular Perl 6 script, you'd also have to consider the order in
which you do a similar thing. First, you need to make sure the include
paths are correct, so the module can be found. Then, you have to `use`
the module, so that you can access the subs and classes it exports.
Finally, you want to let it run some piece of code that gets you where
you want to go.

This is what -I, -M and -e do, respectively, when ran as a one-liner
from the shell.

On Sun, 3 Jun 2018 15:47:06 -0700
ToddAndMargo  wrote:

> >>   On Sun, 3 Jun 2018 15:22:17
> >> - -0700 ToddAndMargo  wrote:
> >>   
> >>> On 06/03/2018 03:06 PM, Brad Gilbert wrote:  
>  It's -I. not -I  
> >>>
> >>> perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls
> >>> \*.pm6"); say $a;' Could not open ( my $a, my $b ) =
> >>> RunNoShell("ls \*.pm6"); say $a;. Failed to stat file: no such
> >>> file or directory  
> 
> On 06/03/2018 03:39 PM, Patrick Spek via perl6-users wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> > 
> > You're missing `-e` here, it should be
> > 
> >  perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls
> > \*.pm6");
> > 
> > For further clarification, the `.` after `-I` indicates the
> > directory that is being added to the paths Perl 6 checks for
> > libraries that are being used. Hence the `.` is needed to indicate
> > the current directory. I'm not sure if `-I` arguments get appended
> > or prepended to the list of paths.
> > 
> > The `-e` is for the expression that is to be run. Otherwise, it'll
> > try to open the argument as if it were a filename, which is why you
> > get the "no such file or directory" error.
> >   
> 
> Indeed!  Thank you!  I am putting this in my Keepers one liner file!
> 
> perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls"); say
> $a;'
> 
> And it does not like the -e until after the I and the M

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUcmUACgkQN/W6H45X
OE/imQf/dNAwMg2/ufFx+5lukuoNjDqEsHsmuOIfR8hk/UZANfC0FYTW5vD6wHXb
DFjwXzmSddAKn9FQkp3A0LuRb01RXn7Bd1i9aUI+a/1Q4djXRyD4TJDVhrE3OAXo
o4/T3DKnNQchcvyMjxog1fimPUZspC9jGz57FJUnA3Q3lKgS7HHsT+aUIs34lyC7
HiTtuWXrL1EFxGgww96ig6ce+/yaRT8oFzadGBcokmo+mP6b4oCufqmJYRXohjUh
oQxSRnduzgnHyIoxFeUFpIqZYK/8471wD4Eqz//QyBBOltQR8s2Bj2BaFDpnB2Gy
3XWRmdgCVJlKvkWH+dHumsWR9ZiaYw==
=/+hA
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo  wrote:

> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
> > It is allowed if you have 'unit module RunNoShell;' at the top of
> > RunNoShell.pm6. Otherwise you defined it in the main namespace and
> > looking for it in the RunNoShell namespace will fail.
> >
> > Perl 5 does the same thing fi you omitted 'package RunNoShell;' at the
> > top of RunNoShell.pm.
> >
>
> The name of the file is `RunNoShell.pm`
>
> It has two exported subs:
>   sub RunNoShellErr ( $RunString ) is export
>   sub RunNoShell ( $RunString ) is export
>
> If I place
>   unit module RunNoShell;
>
> at the top, what happens?
>  All subs get exported?
>  Do I have to import them differently
>

What happens is your two subs get the full names

RunNoShell::RunNoShellErr
RunNoShell::RunNoShell

Without those lines, their full names are

MAIN::RunNoShellErr
MAIN::RunNoShell

Since you are explicitly running RunNoShell::RunNoShell, you get an error
with the second because there is no sub by that name.

Again, this is no different from Perl 5 if you forget to include 'package
RunNoShell;' And this matters only in the case where you explicitly asked
for RunNoShell::RunNoShell instead of just RunNoShell, which importing
handles for you.

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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

  On Sun, 3 Jun 2018 15:22:17
- -0700 ToddAndMargo  wrote:


On 06/03/2018 03:06 PM, Brad Gilbert wrote:

It's -I. not -I


perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls \*.pm6");
say $a;' Could not open ( my $a, my $b ) = RunNoShell("ls \*.pm6");
say $a;. Failed to stat file: no such file or directory


On 06/03/2018 03:39 PM, Patrick Spek via perl6-users wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

You're missing `-e` here, it should be

 perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls \*.pm6");

For further clarification, the `.` after `-I` indicates the directory
that is being added to the paths Perl 6 checks for libraries that are
being used. Hence the `.` is needed to indicate the current directory.
I'm not sure if `-I` arguments get appended or prepended to the list of
paths.

The `-e` is for the expression that is to be run. Otherwise, it'll try
to open the argument as if it were a filename, which is why you get the
"no such file or directory" error.



Indeed!  Thank you!  I am putting this in my Keepers one liner file!

perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls"); say $a;'

And it does not like the -e until after the I and the M


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

You're missing `-e` here, it should be

perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls \*.pm6");

For further clarification, the `.` after `-I` indicates the directory
that is being added to the paths Perl 6 checks for libraries that are
being used. Hence the `.` is needed to indicate the current directory.
I'm not sure if `-I` arguments get appended or prepended to the list of
paths.

The `-e` is for the expression that is to be run. Otherwise, it'll try
to open the argument as if it were a filename, which is why you get the
"no such file or directory" error.

 On Sun, 3 Jun 2018 15:22:17
- -0700 ToddAndMargo  wrote:

> On 06/03/2018 03:06 PM, Brad Gilbert wrote:
> > It's -I. not -I  
> 
> perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls \*.pm6");
> say $a;' Could not open ( my $a, my $b ) = RunNoShell("ls \*.pm6");
> say $a;. Failed to stat file: no such file or directory

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUbgcACgkQN/W6H45X
OE8tcwf8DObCw9+ZDF2cNGfy8p4fc69HFS/FYjcfEGISFYZwi+s+xluQ7N1OTmKx
8Eiw0h5JFXh3CQTB2gFchjRzMjxhuXR1dqhPTUqak89s9919oiNcxQUvF5iJ61o+
SIB8xXDvqfrV6ogTX8fetqWPWL3MN2o0j6UewelCzh/TyG0etZ8b/QhJCZe3pYi7
FTHTMrgFjhb2bZhrP7qFchc/GzvhNedN9Gz5ppti8tdxDNSPLDQiHyTxCULi1Zqo
/afENk+qyGn6u3x03WFCdMMN7m0G5Xxcn8spvApbBwjWJYL8o183oxEFJkHyic8J
BwNwa7oMN1/ZovFHdhFsSh5s+8KcCQ==
=u8yi
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo
On Sun, Jun 3, 2018 at 6:22 PM ToddAndMargo > wrote:


On 06/03/2018 03:07 PM, Brandon Allbery wrote:
 > I'm still trying to figure out why you have just "lib" instead of
"use
 > lib" there. And why it's not throwing an error.

As poop!   I was mixing Perl 5 and Perl 6.


$ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) =
RunNoShell("ls");
say $a;'

Works

But

$ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) =
RunNoShell::RunNoShell("ls6"); say $a;'
Could not find symbol '&RunNoShell'
in block  at -e line 1

The syntax `RunNoShell::RunNoShell` comes from Perl 5.  Is this
not allows in Perl 6?


On 06/03/2018 03:24 PM, Brandon Allbery wrote:
It is allowed if you have 'unit module RunNoShell;' at the top of 
RunNoShell.pm6. Otherwise you defined it in the main namespace and 
looking for it in the RunNoShell namespace will fail.


Perl 5 does the same thing fi you omitted 'package RunNoShell;' at the 
top of RunNoShell.pm.




The name of the file is `RunNoShell.pm`

It has two exported subs:
 sub RunNoShellErr ( $RunString ) is export
 sub RunNoShell ( $RunString ) is export

If I place
 unit module RunNoShell;

at the top, what happens?
All subs get exported?
Do I have to import them differently

   Old way:
   use RunNoShell;  # qx[ RunNoShell ];


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 03:25 PM, Brandon Allbery wrote:
What do you think the path is? Do you still think after being told twice 
that the / is necessary? If you must cargo cult then say -I./ instead of 
-I..



The default "lib" path for perl 6 does not include this directory.

perl6 -I./ -MRunNoShell '( my $a, my $b ) = RunNoShell("ls \*.pm6"); say 
$a;'


Could not open ( my $a, my $b ) = RunNoShell("ls \*.pm6"); say $a;. 
Failed to stat file: no such file or directory


I am confused


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
What do you think the path is? Do you still think after being told twice
that the / is necessary? If you must cargo cult then say -I./ instead of
-I..

On Sun, Jun 3, 2018 at 6:24 PM ToddAndMargo  wrote:

> >> On Sun, Jun 3, 2018 at 6:06 PM ToddAndMargo  >> > wrote:
> >>
> >> On 06/03/2018 02:54 PM, Brad Gilbert wrote:
> >>  > You can use q[./] instead of \'./\'
> >>  > (especially useful so that it will work on both Windows and Unix
> >>  >
> >>  > But in this case it is even better to use -I and -M
> >>  >
> >>  >  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
> >>  >   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> >>  >
> >>  > On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo
> >> mailto:toddandma...@zoho.com>> wrote:
> >>   On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo
> >> mailto:toddandma...@zoho.com>
> >>    >>>
> >> wrote:
> >>  
> >>    Hi All,
> >>  
> >>    What am I doing wrong here?
> >>  
> >>  
> >>   $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b
> ) =
> >>    RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> >>  
> >>   bash: syntax error near unexpected token `='
> >>  
> >>    Huh ???
> >>  
> >>  
> >>    This is RunNoShell.pm6
> >>  
> >>  sub RunNoShell ( $RunString ) is export {
> >>     ...
> >>     return ( $ReturnStr, $RtnCode );
> >>  }
> >>  
> >>    Many thanks,
> >>    -T
> >>  >>
> >>  >>
> >>  >> On 06/03/2018 02:36 PM, Brandon Allbery wrote:
> >>  >>>
> >>  >>> bash doesn't like nested single quotes, even with escapes. So
> >> the first \'
> >>  >>> gave you a literal backslash and ended the quoted part, then
> >> the second \'
> >>  >>> gave you a literal ' and continued without quoting. The final '
> >> would then
> >>  >>> open a new quoted string, but bash doesn't get that far because
> >> it sees the
> >>  >>> (now unquoted) parentheses and tries to parse them as a command
> >> expansion.
> >>  >>>
> >>  >>> allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
> >>  >>>   > ^C
> >>  >>>
> >>  >>> Note that it thinks it's still in a quoted string and wants me
> to
> >>  >>> continue.
> >>  >>>
> >>  >>
> >>  >> p6 does not like `lib ./`,  meaning use the current directory
> >>  >> without the single quotes.  Any work around?
> >>
> >> It needs the path, which is ./
> >>
> >> $ perl6 -I -MRunNoShell '( my $a, my $b ) =
> RunNoShell::RunNoShell("ls
> >> \*.pm6"); say $a;'
> >>
> >> Could not open ( my $a, my $b ) = RunNoShell::RunNoShell("ls
> \*.pm6");
> >> say $a;. Failed to stat file: no such file or directory
>
> On 06/03/2018 03:09 PM, Brandon Allbery wrote:
> > No, the path is just '.'. The trailing '/' does nothing. (Actually, it
> > will be handled as './.' which is also the same as just '.'.)
> >
> > Trailing slash somehow being required for directories is a bit of shell
> > cargo culting.
> >
>
> So how would I put the path into `-I. -M`?
>


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


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
It is allowed if you have 'unit module RunNoShell;' at the top of
RunNoShell.pm6. Otherwise you defined it in the main namespace and looking
for it in the RunNoShell namespace will fail.

Perl 5 does the same thing fi you omitted 'package RunNoShell;' at the top
of RunNoShell.pm.

On Sun, Jun 3, 2018 at 6:22 PM ToddAndMargo  wrote:

> On 06/03/2018 03:07 PM, Brandon Allbery wrote:
> > I'm still trying to figure out why you have just "lib" instead of "use
> > lib" there. And why it's not throwing an error.
>
> As poop!   I was mixing Perl 5 and Perl 6.
>
>
> $ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) = RunNoShell("ls");
> say $a;'
>
> Works
>
> But
>
> $ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) =
> RunNoShell::RunNoShell("ls6"); say $a;'
> Could not find symbol '&RunNoShell'
>in block  at -e line 1
>
> The syntax `RunNoShell::RunNoShell` comes from Perl 5.  Is this
> not allows in Perl 6?
>


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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo
On Sun, Jun 3, 2018 at 6:06 PM ToddAndMargo > wrote:


On 06/03/2018 02:54 PM, Brad Gilbert wrote:
 > You can use q[./] instead of \'./\'
 > (especially useful so that it will work on both Windows and Unix
 >
 > But in this case it is even better to use -I and -M
 >
 >  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
 >   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
 >
 > On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo
mailto:toddandma...@zoho.com>> wrote:
  On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo
mailto:toddandma...@zoho.com>
  >>
wrote:
 
   Hi All,
 
   What am I doing wrong here?
 
 
  $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
 
  bash: syntax error near unexpected token `='
 
   Huh ???
 
 
   This is RunNoShell.pm6
 
 sub RunNoShell ( $RunString ) is export {
    ...
    return ( $ReturnStr, $RtnCode );
 }
 
   Many thanks,
   -T
 >>
 >>
 >> On 06/03/2018 02:36 PM, Brandon Allbery wrote:
 >>>
 >>> bash doesn't like nested single quotes, even with escapes. So
the first \'
 >>> gave you a literal backslash and ended the quoted part, then
the second \'
 >>> gave you a literal ' and continued without quoting. The final '
would then
 >>> open a new quoted string, but bash doesn't get that far because
it sees the
 >>> (now unquoted) parentheses and tries to parse them as a command
expansion.
 >>>
 >>> allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
 >>>   > ^C
 >>>
 >>> Note that it thinks it's still in a quoted string and wants me to
 >>> continue.
 >>>
 >>
 >> p6 does not like `lib ./`,  meaning use the current directory
 >> without the single quotes.  Any work around?

It needs the path, which is ./

$ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls
\*.pm6"); say $a;'

Could not open ( my $a, my $b ) = RunNoShell::RunNoShell("ls \*.pm6");
say $a;. Failed to stat file: no such file or directory


On 06/03/2018 03:09 PM, Brandon Allbery wrote:
No, the path is just '.'. The trailing '/' does nothing. (Actually, it 
will be handled as './.' which is also the same as just '.'.)


Trailing slash somehow being required for directories is a bit of shell 
cargo culting.




So how would I put the path into `-I. -M`?


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 03:06 PM, Brad Gilbert wrote:

It's -I. not -I


perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls \*.pm6"); say $a;'
Could not open ( my $a, my $b ) = RunNoShell("ls \*.pm6"); say $a;. 
Failed to stat file: no such file or directory


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 03:07 PM, Brandon Allbery wrote:
I'm still trying to figure out why you have just "lib" instead of "use 
lib" there. And why it's not throwing an error.


As poop!   I was mixing Perl 5 and Perl 6.


$ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) = RunNoShell("ls"); 
say $a;'


Works

But

$ p6 'use lib <./>; use RunNoShell; ( my $a, my $b ) = 
RunNoShell::RunNoShell("ls6"); say $a;'

Could not find symbol '&RunNoShell'
  in block  at -e line 1

The syntax `RunNoShell::RunNoShell` comes from Perl 5.  Is this
not allows in Perl 6?


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
No, the path is just '.'. The trailing '/' does nothing. (Actually, it will
be handled as './.' which is also the same as just '.'.)

Trailing slash somehow being required for directories is a bit of shell
cargo culting.

On Sun, Jun 3, 2018 at 6:06 PM ToddAndMargo  wrote:

> On 06/03/2018 02:54 PM, Brad Gilbert wrote:
> > You can use q[./] instead of \'./\'
> > (especially useful so that it will work on both Windows and Unix
> >
> > But in this case it is even better to use -I and -M
> >
> >  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
> >   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> >
> > On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo 
> wrote:
>  On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo   > wrote:
> 
>   Hi All,
> 
>   What am I doing wrong here?
> 
> 
>  $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
>   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> 
>  bash: syntax error near unexpected token `='
> 
>   Huh ???
> 
> 
>   This is RunNoShell.pm6
> 
> sub RunNoShell ( $RunString ) is export {
>    ...
>    return ( $ReturnStr, $RtnCode );
> }
> 
>   Many thanks,
>   -T
> >>
> >>
> >> On 06/03/2018 02:36 PM, Brandon Allbery wrote:
> >>>
> >>> bash doesn't like nested single quotes, even with escapes. So the
> first \'
> >>> gave you a literal backslash and ended the quoted part, then the
> second \'
> >>> gave you a literal ' and continued without quoting. The final ' would
> then
> >>> open a new quoted string, but bash doesn't get that far because it
> sees the
> >>> (now unquoted) parentheses and tries to parse them as a command
> expansion.
> >>>
> >>> allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
> >>>   > ^C
> >>>
> >>> Note that it thinks it's still in a quoted string and wants me to
> >>> continue.
> >>>
> >>
> >> p6 does not like `lib ./`,  meaning use the current directory
> >> without the single quotes.  Any work around?
>
> It needs the path, which is ./
>
> $ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls
> \*.pm6"); say $a;'
>
> Could not open ( my $a, my $b ) = RunNoShell::RunNoShell("ls \*.pm6");
> say $a;. Failed to stat file: no such file or directory
>


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


Re: need second pair of eyes

2018-06-03 Thread Brad Gilbert
It's -I. not -I

On Sun, Jun 3, 2018 at 5:05 PM, ToddAndMargo  wrote:
> On 06/03/2018 02:54 PM, Brad Gilbert wrote:
>>
>> You can use q[./] instead of \'./\'
>> (especially useful so that it will work on both Windows and Unix
>>
>> But in this case it is even better to use -I and -M
>>
>>  p6 -I. -MRunNoShell -e '( my $a, my $b ) =
>>   RunNoShell::RunNoShell("ls *.pm6"); say $a;'
>>
>> On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo 
>> wrote:
>
> On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo  > wrote:
>
>  Hi All,
>
>  What am I doing wrong here?
>
>
> $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
>  RunNoShell::RunNoShell("ls *.pm6"); say $a;'
>
> bash: syntax error near unexpected token `='
>
>  Huh ???
>
>
>  This is RunNoShell.pm6
>
>sub RunNoShell ( $RunString ) is export {
>   ...
>   return ( $ReturnStr, $RtnCode );
>}
>
>  Many thanks,
>  -T
>>>
>>>
>>>
>>> On 06/03/2018 02:36 PM, Brandon Allbery wrote:


 bash doesn't like nested single quotes, even with escapes. So the first
 \'
 gave you a literal backslash and ended the quoted part, then the second
 \'
 gave you a literal ' and continued without quoting. The final ' would
 then
 open a new quoted string, but bash doesn't get that far because it sees
 the
 (now unquoted) parentheses and tries to parse them as a command
 expansion.

 allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
   > ^C

 Note that it thinks it's still in a quoted string and wants me to
 continue.

>>>
>>> p6 does not like `lib ./`,  meaning use the current directory
>>> without the single quotes.  Any work around?
>
>
> It needs the path, which is ./
>
> $ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls
> \*.pm6"); say $a;'
>
> Could not open ( my $a, my $b ) = RunNoShell::RunNoShell("ls \*.pm6"); say
> $a;. Failed to stat file: no such file or directory


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
I'm still trying to figure out why you have just "lib" instead of "use lib"
there. And why it's not throwing an error.

On Sun, Jun 3, 2018 at 6:02 PM ToddAndMargo  wrote:

> On 06/03/2018 02:50 PM, Brandon Allbery wrote:
> > Double quotes, or the one we were just discussing a few minutes ago.
> >
> >  use lib "./";
> >  use lib <./>;
> >
> > The trailing / doesn't do anything useful there, by the way.
> >
> > On Sun, Jun 3, 2018 at 5:48 PM ToddAndMargo  > > wrote:
> >
> >  >> On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo
> > mailto:toddandma...@zoho.com>
> >  >> >>
> > wrote:
> >  >>
> >  >> Hi All,
> >  >>
> >  >> What am I doing wrong here?
> >  >>
> >  >>
> >  >>$ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
> >  >> RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> >  >>
> >  >>bash: syntax error near unexpected token `='
> >  >>
> >  >> Huh ???
> >  >>
> >  >>
> >  >> This is RunNoShell.pm6
> >  >>
> >  >>   sub RunNoShell ( $RunString ) is export {
> >  >>  ...
> >  >>  return ( $ReturnStr, $RtnCode );
> >  >>   }
> >  >>
> >  >> Many thanks,
> >  >> -T
> >
> > On 06/03/2018 02:36 PM, Brandon Allbery wrote:
> >  > bash doesn't like nested single quotes, even with escapes. So the
> > first
> >  > \' gave you a literal backslash and ended the quoted part, then
> the
> >  > second \' gave you a literal ' and continued without quoting. The
> > final
> >  > ' would then open a new quoted string, but bash doesn't get that
> far
> >  > because it sees the (now unquoted) parentheses and tries to parse
> > them
> >  > as a command expansion.
> >  >
> >  > allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
> >  >  > ^C
> >  >
> >  > Note that it thinks it's still in a quoted string and wants me to
> > continue.
> >  >
> >
> > p6 does not like `lib ./`,  meaning use the current directory
> > without the single quotes.  Any work around?
>
>
> sniffle ...
>
> $ p6 'lib "./"; use RunNoShell; ( my $a, my $b ) =
> RunNoShell::RunNoShell("ls \*.pm6"); say $a;'
> ===SORRY!===
> Could not find RunNoShell at line 1 in:
>  /root/.perl6
>  /opt/rakudo-pkg/share/perl6/site
>  /opt/rakudo-pkg/share/perl6/vendor
>  /opt/rakudo-pkg/share/perl6
>  CompUnit::Repository::AbsolutePath<62676288>
>  CompUnit::Repository::NQP<39210120>
>  CompUnit::Repository::Perl5<39210160>
>
> $ p6 'lib <./>; use RunNoShell; ( my $a, my $b ) =
> RunNoShell::RunNoShell("ls \*.pm6"); say $a;'
> ===SORRY!===
> Could not find RunNoShell at line 1 in:
>  /root/.perl6
>  /opt/rakudo-pkg/share/perl6/site
>  /opt/rakudo-pkg/share/perl6/vendor
>  /opt/rakudo-pkg/share/perl6
>  CompUnit::Repository::AbsolutePath<70406256>
>  CompUnit::Repository::NQP<46533808>
>  CompUnit::Repository::Perl5<46533848>
>


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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 02:54 PM, Brad Gilbert wrote:

You can use q[./] instead of \'./\'
(especially useful so that it will work on both Windows and Unix

But in this case it is even better to use -I and -M

 p6 -I. -MRunNoShell -e '( my $a, my $b ) =
  RunNoShell::RunNoShell("ls *.pm6"); say $a;'

On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo  wrote:

On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo mailto:toddandma...@zoho.com>> wrote:

 Hi All,

 What am I doing wrong here?


$ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
 RunNoShell::RunNoShell("ls *.pm6"); say $a;'

bash: syntax error near unexpected token `='

 Huh ???


 This is RunNoShell.pm6

   sub RunNoShell ( $RunString ) is export {
  ...
  return ( $ReturnStr, $RtnCode );
   }

 Many thanks,
 -T



On 06/03/2018 02:36 PM, Brandon Allbery wrote:


bash doesn't like nested single quotes, even with escapes. So the first \'
gave you a literal backslash and ended the quoted part, then the second \'
gave you a literal ' and continued without quoting. The final ' would then
open a new quoted string, but bash doesn't get that far because it sees the
(now unquoted) parentheses and tries to parse them as a command expansion.

allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
  > ^C

Note that it thinks it's still in a quoted string and wants me to
continue.



p6 does not like `lib ./`,  meaning use the current directory
without the single quotes.  Any work around?


It needs the path, which is ./

$ perl6 -I -MRunNoShell '( my $a, my $b ) = RunNoShell::RunNoShell("ls 
\*.pm6"); say $a;'


Could not open ( my $a, my $b ) = RunNoShell::RunNoShell("ls \*.pm6"); 
say $a;. Failed to stat file: no such file or directory


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo

On 06/03/2018 02:50 PM, Brandon Allbery wrote:

Double quotes, or the one we were just discussing a few minutes ago.

     use lib "./";
     use lib <./>;

The trailing / doesn't do anything useful there, by the way.

On Sun, Jun 3, 2018 at 5:48 PM ToddAndMargo > wrote:


 >> On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo
mailto:toddandma...@zoho.com>
 >> >>
wrote:
 >>
 >>     Hi All,
 >>
 >>     What am I doing wrong here?
 >>
 >>
 >>            $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
 >>     RunNoShell::RunNoShell("ls *.pm6"); say $a;'
 >>
 >>            bash: syntax error near unexpected token `='
 >>
 >>     Huh ???
 >>
 >>
 >>     This is RunNoShell.pm6
 >>
 >>           sub RunNoShell ( $RunString ) is export {
 >>              ...
 >>              return ( $ReturnStr, $RtnCode );
 >>           }
 >>
 >>     Many thanks,
 >>     -T

On 06/03/2018 02:36 PM, Brandon Allbery wrote:
 > bash doesn't like nested single quotes, even with escapes. So the
first
 > \' gave you a literal backslash and ended the quoted part, then the
 > second \' gave you a literal ' and continued without quoting. The
final
 > ' would then open a new quoted string, but bash doesn't get that far
 > because it sees the (now unquoted) parentheses and tries to parse
them
 > as a command expansion.
 >
 > allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
 >  > ^C
 >
 > Note that it thinks it's still in a quoted string and wants me to
continue.
 >

p6 does not like `lib ./`,  meaning use the current directory
without the single quotes.  Any work around?



sniffle ...

$ p6 'lib "./"; use RunNoShell; ( my $a, my $b ) = 
RunNoShell::RunNoShell("ls \*.pm6"); say $a;'

===SORRY!===
Could not find RunNoShell at line 1 in:
/root/.perl6
/opt/rakudo-pkg/share/perl6/site
/opt/rakudo-pkg/share/perl6/vendor
/opt/rakudo-pkg/share/perl6
CompUnit::Repository::AbsolutePath<62676288>
CompUnit::Repository::NQP<39210120>
CompUnit::Repository::Perl5<39210160>

$ p6 'lib <./>; use RunNoShell; ( my $a, my $b ) = 
RunNoShell::RunNoShell("ls \*.pm6"); say $a;'

===SORRY!===
Could not find RunNoShell at line 1 in:
/root/.perl6
/opt/rakudo-pkg/share/perl6/site
/opt/rakudo-pkg/share/perl6/vendor
/opt/rakudo-pkg/share/perl6
CompUnit::Repository::AbsolutePath<70406256>
CompUnit::Repository::NQP<46533808>
CompUnit::Repository::Perl5<46533848>


Re: need second pair of eyes

2018-06-03 Thread Brad Gilbert
You can use q[./] instead of \'./\'
(especially useful so that it will work on both Windows and Unix

But in this case it is even better to use -I and -M

p6 -I. -MRunNoShell -e '( my $a, my $b ) =
 RunNoShell::RunNoShell("ls *.pm6"); say $a;'

On Sun, Jun 3, 2018 at 4:47 PM, ToddAndMargo  wrote:
>>> On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo >> > wrote:
>>>
>>> Hi All,
>>>
>>> What am I doing wrong here?
>>>
>>>
>>>$ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
>>> RunNoShell::RunNoShell("ls *.pm6"); say $a;'
>>>
>>>bash: syntax error near unexpected token `='
>>>
>>> Huh ???
>>>
>>>
>>> This is RunNoShell.pm6
>>>
>>>   sub RunNoShell ( $RunString ) is export {
>>>  ...
>>>  return ( $ReturnStr, $RtnCode );
>>>   }
>>>
>>> Many thanks,
>>> -T
>
>
> On 06/03/2018 02:36 PM, Brandon Allbery wrote:
>>
>> bash doesn't like nested single quotes, even with escapes. So the first \'
>> gave you a literal backslash and ended the quoted part, then the second \'
>> gave you a literal ' and continued without quoting. The final ' would then
>> open a new quoted string, but bash doesn't get that far because it sees the
>> (now unquoted) parentheses and tries to parse them as a command expansion.
>>
>> allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
>>  > ^C
>>
>> Note that it thinks it's still in a quoted string and wants me to
>> continue.
>>
>
> p6 does not like `lib ./`,  meaning use the current directory
> without the single quotes.  Any work around?


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
Double quotes, or the one we were just discussing a few minutes ago.

use lib "./";
use lib <./>;

The trailing / doesn't do anything useful there, by the way.

On Sun, Jun 3, 2018 at 5:48 PM ToddAndMargo  wrote:

> >> On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo  >> > wrote:
> >>
> >> Hi All,
> >>
> >> What am I doing wrong here?
> >>
> >>
> >>$ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
> >> RunNoShell::RunNoShell("ls *.pm6"); say $a;'
> >>
> >>bash: syntax error near unexpected token `='
> >>
> >> Huh ???
> >>
> >>
> >> This is RunNoShell.pm6
> >>
> >>   sub RunNoShell ( $RunString ) is export {
> >>  ...
> >>  return ( $ReturnStr, $RtnCode );
> >>   }
> >>
> >> Many thanks,
> >> -T
>
> On 06/03/2018 02:36 PM, Brandon Allbery wrote:
> > bash doesn't like nested single quotes, even with escapes. So the first
> > \' gave you a literal backslash and ended the quoted part, then the
> > second \' gave you a literal ' and continued without quoting. The final
> > ' would then open a new quoted string, but bash doesn't get that far
> > because it sees the (now unquoted) parentheses and tries to parse them
> > as a command expansion.
> >
> > allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
> >  > ^C
> >
> > Note that it thinks it's still in a quoted string and wants me to
> continue.
> >
>
> p6 does not like `lib ./`,  meaning use the current directory
> without the single quotes.  Any work around?
>


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


Re: need second pair of eyes

2018-06-03 Thread ToddAndMargo
On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo > wrote:


Hi All,

What am I doing wrong here?


   $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
RunNoShell::RunNoShell("ls *.pm6"); say $a;'

   bash: syntax error near unexpected token `='

Huh ???


This is RunNoShell.pm6

  sub RunNoShell ( $RunString ) is export {
 ...
 return ( $ReturnStr, $RtnCode );
  }

Many thanks,
-T


On 06/03/2018 02:36 PM, Brandon Allbery wrote:
bash doesn't like nested single quotes, even with escapes. So the first 
\' gave you a literal backslash and ended the quoted part, then the 
second \' gave you a literal ' and continued without quoting. The final 
' would then open a new quoted string, but bash doesn't get that far 
because it sees the (now unquoted) parentheses and tries to parse them 
as a command expansion.


allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
 > ^C

Note that it thinks it's still in a quoted string and wants me to continue.



p6 does not like `lib ./`,  meaning use the current directory
without the single quotes.  Any work around?


Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
bash doesn't like nested single quotes, even with escapes. So the first \'
gave you a literal backslash and ended the quoted part, then the second \'
gave you a literal ' and continued without quoting. The final ' would then
open a new quoted string, but bash doesn't get that far because it sees the
(now unquoted) parentheses and tries to parse them as a command expansion.

allbery@pyanfar ~/Downloads $ echo 'x\'y\'z'
> ^C

Note that it thinks it's still in a quoted string and wants me to continue.

On Sun, Jun 3, 2018 at 5:28 PM ToddAndMargo  wrote:

> Hi All,
>
> What am I doing wrong here?
>
>
>   $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) =
> RunNoShell::RunNoShell("ls *.pm6"); say $a;'
>
>   bash: syntax error near unexpected token `='
>
> Huh ???
>
>
> This is RunNoShell.pm6
>
>  sub RunNoShell ( $RunString ) is export {
> ...
> return ( $ReturnStr, $RtnCode );
>  }
>
> Many thanks,
> -T
>


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


need second pair of eyes

2018-06-03 Thread ToddAndMargo

Hi All,

What am I doing wrong here?


 $ p6 'lib \'./\'; use RunNoShell; ( my $a, my $b ) = 
RunNoShell::RunNoShell("ls *.pm6"); say $a;'


 bash: syntax error near unexpected token `='

Huh ???


This is RunNoShell.pm6

sub RunNoShell ( $RunString ) is export {
   ...
   return ( $ReturnStr, $RtnCode );
}

Many thanks,
-T