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    

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 =

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

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: >

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,

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

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 >

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 > > ~~ |

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

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

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 ) =

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

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")

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

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

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,

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

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

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

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).

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: > >

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

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.

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

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

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

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

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

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 '(

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: >

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,

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

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;'

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

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

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. > >

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

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 >

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,

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 >>

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

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