Re: need mkdir, chown, chmod, del

2018-06-03 Thread ToddAndMargo

On 06/03/2018 10:04 AM, ToddAndMargo wrote:

Hi All,

I need the Perl6 commands for the following LINUX
commands.

mkdir  make directory
chown  change ownership
chmod  change file mode bits
del    delete file


Many thanks,
-T




Hi All,

Today's final Keeper file on IO

-T


Perl 6: File commands

Reference: https://docs.perl6.org/type/IO::Path

Note: copy and move are at the bottom of this list


chown (change ownership):
   Not implemented; use a system call


Directory, make:
mkdir DIRPATH, attrible
   mkdir $WorkingDir, 0o766;
Note: `mkdir` will create parent directories recursively


Directory, remove:
rmdir PATH
Delete all specified ordinary files, links, or symbolic links.
returns True (1) or False (0)

if rmdir $DirPath { say "worked } else { say "directory remove 
failed" };


For recursive (parents), use `rmtree` in the 
`File::Directory::Tree` module, or

use a sysem call to `rmdir --parents DIR`
$RtStr, $RtnErr, $RtnCode = RunNoShellErr( "rmdir --Parents 
{$DirPath}" );




Delete:
unlink PATH
Delete all specified ordinary files, links, or symbolic links.
returns True (1) or False (0)

if unlink $FileName { say "worked } else { say "Delete Failed" };


Directory (ls, dir):
dir PATH
   for dir "{$WorkingDirectory}" -> $Content { say $Content };

Note: for a recursice rmdir, use
   https://github.com/labster/p6-file-directory-tree


Exists (directory):
   DIRPATH.IO.d.Boo;
   if not $WorkingDir.IO.d.Bool { mkdir $WorkingDir, 0o766; }


Exists (file):
   FILEPATH.IO.e
   if  $NewFileName.IO.e { $NewFileSize = $NewFileName.IO.s; } else 
{ return 4; }



File permission (retrieve):
say "path/to/file".IO.mode;


File permission (set):
PERMISSIONS."path/to/file".IO.mode;
 0o755.$FilePath.IO.mode;
 chmod 0o755, < myfile1 myfile2 >;   <-- DON'T FORGET THE 
COMMA!

 $ p6 'chmod 0o777, < "a", "b", "c" >;'
 $ p6 'chmod 0o777, < a b c >;'
 $ p6 'chmod 0o777, "a", "b", "c";'
 $ p6 'my $x = "a"; chmod 0o777, < $x b c >;'


Size:
   FILEPATH.IO.s
   $FileSize = $CorePath.IO.s;



catdir  (Concatenates multiple path fragments)
https://docs.perl6.org/routine/catdir

chdir
https://docs.perl6.org/routine/chdir

curdir  (current directory)
https://docs.perl6.org/routine/curdir

curupdir (Returns a none Junction of strings representing the current 
directory

  and the "one directory up")
https://docs.perl6.org/routine/curupdir

dir
https://docs.perl6.org/routine/dir

 $ perl6 -e 'for dir() -> $x { my $y="$x"; say $y };'
 $ perl6 -e 'for dir("/home/kvm") -> $x { my $y="$x"; say $y };'

 Note in the above, $x is an IO::Path, not a string.  Assigning
 it to $y converts it.  The Quotes around "$x" are necessary

dir-sep (Returns the string "/" "\" representing canonical directory 
separator character)

https://docs.perl6.org/routine/dir-sep

dirname
https://docs.perl6.org/routine/dirname

indir
https://docs.perl6.org/routine/indir
 "indir" is not "is this file in this directory?", it's "run this 
code in this
 directory instead of where I am now". So it's complaining that you 
didn't tell

 it what code to run there.

mkdir
https://docs.perl6.org/routine/mkdir

rmdir
https://docs.perl6.org/routine/rmdir

rootdir (Returns string '/', representing root directory)
https://docs.perl6.org/routine/rootdir

splitdir (Splits the given $path on slashes and backslashes)
https://docs.perl6.org/routine/splitdir

tmpdir
https://docs.perl6.org/routine/tmpdir

updir
https://docs.perl6.org/routine/updir

move
https://docs.perl6.org/routine/move

copy
https://docs.perl6.org/routine/copy


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: How to print colorized text to the terminal

2018-06-03 Thread Brent Laabs
You might want to consider using Terminal::ANSIColor.

On Sun, Jun 3, 2018 at 5:53 PM, Xin Cheng  wrote:

> I just tried to use "put" in place of "say", and got the same result.
>
> Thanks.
>
> Ziping
>
>
> On Jun 3, 2018, at 8:44 PM, Brandon Allbery  wrote:
>
> "say" uses the .gist method, which quotes the output for readability. You
> probably want "put" instead.
>
> On Sun, Jun 3, 2018 at 8:42 PM Xin Cheng  wrote:
>
>> Hi,
>>
>> I am trying to make a program to do grep with perl6 regular expression,
>> and I would like to colorize the matched part to the terminal. So the
>> following is what I wrote
>>
>> sub MAIN(Str $pattern,Str $filename){
>> for $filename.IO.lines -> $line  {
>> my Str $temp = $line;
>> if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say $temp};
>> # if no <> surrounding $pattern it becomes literal.
>> }
>> }
>>
>> And I named the program as grep6, and I tried it in zsh as
>>
>> > grep6 'M.*N' =grep6
>>
>> And I got,
>>
>> sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){
>>
>> How do I turn the string into color?
>>
>> Thanks!
>>
>> Xin
>>
>
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
>
>


Re: How to print colorized text to the terminal

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

In proper Perl fashion, there's a module for this:
https://github.com/tadzik/Terminal-ANSIColor

I haven't used it myself, so I'm not sure how well it works, but it's
worth a shot at least.

On Sun, 3 Jun 2018 20:41:32 -0400
Xin Cheng  wrote:

> Hi,
> 
> I am trying to make a program to do grep with perl6 regular
> expression, and I would like to colorize the matched part to the
> terminal. So the following is what I wrote 
> 
> sub MAIN(Str $pattern,Str $filename){
> for $filename.IO.lines -> $line  {
> my Str $temp = $line;
> if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say
> $temp}; # if no <> surrounding $pattern it becomes literal. }
> }
> 
> And I named the program as grep6, and I tried it in zsh as
> 
> > grep6 'M.*N' =grep6  
> 
> And I got,
> 
> sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){
> 
> How do I turn the string into color?
> 
> Thanks!
> 
> Xin
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUlAUACgkQN/W6H45X
OE99fAgAjm1X4aRFUcWcJM2pLnbxy69XxaG//1ZvGROm/+iO96s2/WlTFMf5httI
DJeJFQ5XTzGSwKQUn5PJXhMTCEqzcl8Niqtb/Armat8WCPgXW4DWjhlc9i+4nLiJ
mEv+TljWn1oEUEcC7jO4M60SfddXl9Uy+v5VUnl59NNcX3LwgGRYKQ9e3eDjyIGW
0aKL4KvDw3LvchxGJdc8BeNXvlvQLmyeousaP/xIWLNObphsRME3VDd4myL7dUxJ
bQreldZEFztz4ogTh7a/KnjHGZ46NyaY6LJZh1fa7cRvYNNkIMR8em5Js0/9dSAA
NCTm3why/Z6EBiWrWhPyBNNvRbiYaQ==
=EDFv
-END PGP SIGNATURE-


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: How to print colorized text to the terminal

2018-06-03 Thread Xin Cheng
I just tried to use "put" in place of "say", and got the same result.

Thanks.

Ziping

> On Jun 3, 2018, at 8:44 PM, Brandon Allbery  wrote:
> 
> "say" uses the .gist method, which quotes the output for readability. You 
> probably want "put" instead.
> 
> On Sun, Jun 3, 2018 at 8:42 PM Xin Cheng  > wrote:
> Hi,
> 
> I am trying to make a program to do grep with perl6 regular expression, and I 
> would like to colorize the matched part to the terminal. So the following is 
> what I wrote 
> 
> sub MAIN(Str $pattern,Str $filename){
> for $filename.IO.lines -> $line  {
> my Str $temp = $line;
> if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say $temp}; # if 
> no <> surrounding $pattern it becomes literal.
> }
> }
> 
> And I named the program as grep6, and I tried it in zsh as
> 
> > grep6 'M.*N' =grep6
> 
> And I got,
> 
> sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){
> 
> How do I turn the string into color?
> 
> Thanks!
> 
> Xin
> 
> 
> -- 
> brandon s allbery kf8nh   sine nomine associates
> allber...@gmail.com   
> ballb...@sinenomine.net 
> unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net 
> 


Re: How to print colorized text to the terminal

2018-06-03 Thread Brandon Allbery
"say" uses the .gist method, which quotes the output for readability. You
probably want "put" instead.

On Sun, Jun 3, 2018 at 8:42 PM Xin Cheng  wrote:

> Hi,
>
> I am trying to make a program to do grep with perl6 regular expression,
> and I would like to colorize the matched part to the terminal. So the
> following is what I wrote
>
> sub MAIN(Str $pattern,Str $filename){
> for $filename.IO.lines -> $line  {
> my Str $temp = $line;
> if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say $temp}; #
> if no <> surrounding $pattern it becomes literal.
> }
> }
>
> And I named the program as grep6, and I tried it in zsh as
>
> > grep6 'M.*N' =grep6
>
> And I got,
>
> sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){
>
> How do I turn the string into color?
>
> Thanks!
>
> Xin
>


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


How to print colorized text to the terminal

2018-06-03 Thread Xin Cheng
Hi,

I am trying to make a program to do grep with perl6 regular expression, and I 
would like to colorize the matched part to the terminal. So the following is 
what I wrote 

sub MAIN(Str $pattern,Str $filename){
for $filename.IO.lines -> $line  {
my Str $temp = $line;
if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say $temp}; # if 
no <> surrounding $pattern it becomes literal.
}
}

And I named the program as grep6, and I tried it in zsh as

> grep6 'M.*N' =grep6

And I got,

sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){

How do I turn the string into color?

Thanks!

Xin

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


Re: Is there a built in recursive rmdir and mkdir?

2018-06-03 Thread ToddAndMargo

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

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Sun, 3 Jun 2018 13:13:31 -0700
ToddAndMargo  wrote:


Does Perl 6 have a built in recursive rmdir
equivalent to LINUX's `rmdir --parents path`?


For this, there's `rmtree` in the `File::Directory::Tree` module. It is
referenced in the docs: https://docs.perl6.org/routine/rmdir


I will put that in my notes




Also, does Perl6 have a built in recursive mkdir
equivalent to LINUX's `mkdir --parents path`?


Also in the docs here: https://docs.perl6.org/routine/mkdir. This
behaviour you're looking for is the default behaviour of `mkdir` in
Pelr 6. To quote from the docs:


Also creates parent directories, as needed (similar to *nix utility
mkdir with -p option); that is, mkdir "foo/bar/ber/meow" will create
foo, foo/bar, and foo/bar/ber directories if they do not exist, as
well as foo/bar/ber/meow.


Cool!  I did not see that

https://docs.perl6.org/routine/mkdir#role_IO
and it is right under my nose!

Thank you!


Re: Is there a built in recursive rmdir and mkdir?

2018-06-03 Thread ToddAndMargo

On 06/03/2018 01:19 PM, Tom Browder wrote:

On Sun, Jun 3, 2018 at 3:13 PM, ToddAndMargo  wrote:

Hi All,

Does Perl 6 have a built in recursive rmdir
equivalent to LINUX's `rmdir --parents path`?


Searching for "rmdir" on the docs site, and selecting the sub rmdir
entry, I see the following:

   To delete non-empty directory, see rmtree in File::Directory::Tree module

with a link to the module's github.com repo:

   https://github.com/labster/p6-file-directory-tree


-Tom



Thank you.  I saw that.  I was wondering if there was a build
in function for it.

I have a Perl 5 recursive delete of an FTP directory tree,
where I basically call myself (with a depth limit) to
do a recursive delete that I could modify.

FTP deletes are no fun as you have to change the names
of certain files before they will delete, especially
ones with `+++` in the have (thank you Firefox!).


Re: <> question

2018-06-03 Thread ToddAndMargo

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



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


On 06/03/2018 11:01 AM, Brandon Allbery wrote:

Is there something missing in the examples at the link?


Well, a bit.  When I see

     chmod 0o755, ;

I think `myfile1` and `myfile2` are "functions", not
data.


They aren't, they are a list of strings.

`< a b c >` is short for `qw< a b c>` which is short for `Q :single 
:words < a b c >`


basically `' a b c '.words()`

see https://docs.perl6.org/language/quoting

So the above is really the same as:

chmod 0o755, ( 'myfile1',  'myfile2' );



Thank you!

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


Re: <> question

2018-06-03 Thread ToddAndMargo

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

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

The < > syntax is a bit like qw<> from Perl 5. You'll get a List (or
Array, not sure which type exactly from it. So

 

is a list with two elements, "myfile1" and "myfile2". If you want to
use a variable, you can just provide it with one or more variables:

 chmod 0o755, $myfile
 chmod 0o755, ($myfile1, $myfile2)


Thank you!

$ p6 'my $x = "a"; chmod 0o777, < $x b c >;'


Re: <> question

2018-06-03 Thread ToddAndMargo

On 06/03/2018 01:16 PM, Brandon Allbery wrote:
On Sun, Jun 3, 2018 at 4:09 PM ToddAndMargo > wrote:


$ touch a b c
$ p6 'chmod 0o777 < a b c >;'
===SORRY!=== Error while compiling -e
Preceding context expects a term, but found infix > instead.
at -e:1
--> chmod 0o777 < a b c >⏏;


You're missing the comma after the mode parameter.

     chmod 0o777, < a b c >;

which is the same as

     chmod 0o777, 'a', 'b', 'c';


Ahhh Poop!

Thank you!


Re: <> question

2018-06-03 Thread Brad Gilbert
On Sun, Jun 3, 2018 at 3:08 PM, ToddAndMargo  wrote:

> On 06/03/2018 11:01 AM, Brandon Allbery wrote:
>
>> Is there something missing in the examples at the link?
>>
>
> Well, a bit.  When I see
>
> chmod 0o755, ;
>
> I think `myfile1` and `myfile2` are "functions", not
> data.
>

They aren't, they are a list of strings.

`< a b c >` is short for `qw< a b c>` which is short for `Q :single :words
< a b c >`

basically `' a b c '.words()`

see https://docs.perl6.org/language/quoting

So the above is really the same as:

chmod 0o755, ( 'myfile1',  'myfile2' );


Re: <> question

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

The < > syntax is a bit like qw<> from Perl 5. You'll get a List (or
Array, not sure which type exactly from it. So



is a list with two elements, "myfile1" and "myfile2". If you want to
use a variable, you can just provide it with one or more variables:

chmod 0o755, $myfile
chmod 0o755, ($myfile1, $myfile2)

On Sun, 3 Jun 2018 13:08:26 -0700
ToddAndMargo  wrote:

> On 06/03/2018 11:01 AM, Brandon Allbery wrote:
> > Is there something missing in the examples at the link?  
> 
> Well, a bit.  When I see
> 
>  chmod 0o755, ;
> 
> I think `myfile1` and `myfile2` are "functions", not
> data.
> 
> I instead look for something like
> 
>  chmod 0o755, < $myfile1   $myfile2 >;
> or  chmod 0o755, < "myfile1"  "myfile2" >;
> 
> And to make matter worse, the example does not work:
> 
> $ touch a b c
> $ p6 'chmod 0o777 < a b c >;'
> ===SORRY!=== Error while compiling -e
> Preceding context expects a term, but found infix > instead.
> at -e:1
> --> chmod 0o777 < a b c >⏏;  
> 
> 
> $ p6 'chmod 0o777 < "a" "b" "c" >;'
> ===SORRY!=== Error while compiling -e
> Two terms in a row
> at -e:1
> --> chmod 0o777 < "a"⏏ "b" "c" >;  
>  expecting any of:
>  infix
>  infix stopper
>  postfix
>  statement end
>  statement modifier
>  statement modifier loop
> 
> 
> $ p6 'chmod 0o777 < "a", "b", "c" >;'
> ===SORRY!=== Error while compiling -e
> Missing required term after infix
> at -e:1
> --> chmod 0o777 < "a", "b", "c" >⏏;  
>  expecting any of:
>  prefix
>  term

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUTrcACgkQN/W6H45X
OE/ILwf/X7mElQ7bPzRBA3i7Vm4pi3E6/bUpf2SMz5LB3UhfVKHNSV5/fXGE1a/W
9oa5klItWioH5m+NF+3KeOyufxc1tDm+hN5I2iac8xNTkE4bHfna9tOK03xvQXLf
t3x/jMTW1YN0jsvOWJLCi4UgBOqs/1B5Z3HzV6X1XPXjU1qNphYRf8huRtg+lxBb
CQWFQgKljNzvNVqSWlG3J3XTTXdQZ69juW5LQC+a3C7y0/44jvas0eS/C3uGG48y
O7rDG75V6y8ZfWBzFSIiCycH0fOcnYxE64brsPiaP0limVgMyac4YU15ixrEocxK
Q83aFB+yIYVNSlfYl8Llw2ZofOlM9Q==
=SSBB
-END PGP SIGNATURE-


Re: Is there a built in recursive rmdir and mkdir?

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

On Sun, 3 Jun 2018 13:13:31 -0700
ToddAndMargo  wrote:

> Does Perl 6 have a built in recursive rmdir
> equivalent to LINUX's `rmdir --parents path`?

For this, there's `rmtree` in the `File::Directory::Tree` module. It is
referenced in the docs: https://docs.perl6.org/routine/rmdir

> Also, does Perl6 have a built in recursive mkdir
> equivalent to LINUX's `mkdir --parents path`?

Also in the docs here: https://docs.perl6.org/routine/mkdir. This
behaviour you're looking for is the default behaviour of `mkdir` in
Pelr 6. To quote from the docs: 

> Also creates parent directories, as needed (similar to *nix utility
> mkdir with -p option); that is, mkdir "foo/bar/ber/meow" will create
> foo, foo/bar, and foo/bar/ber directories if they do not exist, as
> well as foo/bar/ber/meow.
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUT2MACgkQN/W6H45X
OE9tPQf/RUGmdavSEDye4RIAbHpIkkikaIfj7dK0ym+63tsb/d1SceBtjK6AX6j8
5mu7/uNYAYWrbOKaxbLCk7lPbT3U20Ata9ntNKadi7irDAo8q9b7y/3GVi2avuQS
j9H2HAEtOfwjXhbBpvCo+Hq2XrTT8/wRyDyHFtm59Uqdx8njtpPwmEcDx/+GQj3r
d/ASoyTNo12CsL0sxTTpE8P93Gcj/lR7xRdmXAieVjSdz3HM7QNaAYsMi4I//qxq
dXONoPtzPrTpH4NJdnfyV+qGG8aHlPEeXAPvKHom92D/TVLu5KQICwqWRddaai9C
pFpDXUu/Tsm2DfFIte6QhKdWXq8tKA==
=rA+y
-END PGP SIGNATURE-


Re: Is there a built in recursive rmdir and mkdir?

2018-06-03 Thread Tom Browder
On Sun, Jun 3, 2018 at 3:13 PM, ToddAndMargo  wrote:
> Hi All,
>
> Does Perl 6 have a built in recursive rmdir
> equivalent to LINUX's `rmdir --parents path`?

Searching for "rmdir" on the docs site, and selecting the sub rmdir
entry, I see the following:

  To delete non-empty directory, see rmtree in File::Directory::Tree module

with a link to the module's github.com repo:

  https://github.com/labster/p6-file-directory-tree


-Tom


Re: <> question

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

> $ touch a b c
> $ p6 'chmod 0o777 < a b c >;'
> ===SORRY!=== Error while compiling -e
> Preceding context expects a term, but found infix > instead.
> at -e:1
> --> chmod 0o777 < a b c >⏏;
>

You're missing the comma after the mode parameter.

chmod 0o777, < a b c >;

which is the same as

chmod 0o777, 'a', 'b', 'c';

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


Is there a built in recursive rmdir and mkdir?

2018-06-03 Thread ToddAndMargo

Hi All,

Does Perl 6 have a built in recursive rmdir
equivalent to LINUX's `rmdir --parents path`?

Also, does Perl6 have a built in recursive mkdir
equivalent to LINUX's `mkdir --parents path`?

Many thanks,
-T


Re: <> question

2018-06-03 Thread ToddAndMargo

On 06/03/2018 11:01 AM, Brandon Allbery wrote:

Is there something missing in the examples at the link?


Well, a bit.  When I see

chmod 0o755, ;

I think `myfile1` and `myfile2` are "functions", not
data.

I instead look for something like

chmod 0o755, < $myfile1   $myfile2 >;
or  chmod 0o755, < "myfile1"  "myfile2" >;

And to make matter worse, the example does not work:

$ touch a b c
$ p6 'chmod 0o777 < a b c >;'
===SORRY!=== Error while compiling -e
Preceding context expects a term, but found infix > instead.
at -e:1
--> chmod 0o777 < a b c >⏏;


$ p6 'chmod 0o777 < "a" "b" "c" >;'
===SORRY!=== Error while compiling -e
Two terms in a row
at -e:1
--> chmod 0o777 < "a"⏏ "b" "c" >;
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
statement modifier loop


$ p6 'chmod 0o777 < "a", "b", "c" >;'
===SORRY!=== Error while compiling -e
Missing required term after infix
at -e:1
--> chmod 0o777 < "a", "b", "c" >⏏;
expecting any of:
prefix
term


Re: <> question

2018-06-03 Thread ToddAndMargo

On 06/03/2018 11:01 AM, Brandon Allbery wrote:

Is there something missing in the examples at the link?


yes, `` is confusing to me.  I can't
tell is `<>` is an editorial comment or Perl syntax.

Is it
chmod 0o755, $f1, $f2;

or
chmod 0o755 <$f1 $f2>;

or either?


Re: need mkdir, chown, chmod, del

2018-06-03 Thread ToddAndMargo

On 06/03/2018 10:04 AM, ToddAndMargo wrote:

Hi All,

I need the Perl6 commands for the following LINUX
commands.

mkdir  make directory
chown  change ownership
chmod  change file mode bits
del    delete file


Many thanks,
-T





Would you mind looking over my notes to see if I make any boo-boos?


Perl 6: File commands

Reference: https://docs.perl6.org/type/IO::Path


chown (change ownership):
   Not implemented; use a system call


Directory, make:
mkdir DIRPATH, attrible
   mkdir $WorkingDir, 0o766;


Directory, remove:
rmdir PATH
Delete all specified ordinary files, links, or symbolic links.
returns True (1) or False (0)

if rmdir $DirPath { say "worked } else { say "directory remove 
failed" };



Delete:
unlink PATH
Delete all specified ordinary files, links, or symbolic links.
returns True (1) or False (0)

if unlink $FileName { say "worked } else { say "Delete Failed" };


Directory (ls, dir):
dir PATH
   for dir "{$WorkingDirectory}" -> $Content { say $Content };

Note: for a recursice rmdir, use
   https://github.com/labster/p6-file-directory-tree


Exists (directory):
   DIRPATH.IO.d.Boo;
   if not $WorkingDir.IO.d.Bool { mkdir $WorkingDir, 0o766; }


Exists (file):
   FILEPATH.IO.e
   if  $NewFileName.IO.e { $NewFileSize = $NewFileName.IO.s; } else 
{ return 4; }



File permission (retrieve):
say "path/to/file".IO.mode;


File permission (set):
PERMISSIONS."path/to/file".IO.mode;
 0o755.$FilePAth.IO.mode;
 chmod 0o755, ;

Size:
   FILEPATH.IO.s
   $FileSize = $CorePath.IO.s;


Re: <> question

2018-06-03 Thread Brandon Allbery
Is there something missing in the examples at the link?

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

> >> https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E
> >>
> >> On Sun, Jun 3, 2018 at 1:42 PM ToddAndMargo  >> > wrote:
> >>
> >> What is this?
> >>
> >> https://docs.perl6.org/routine/chmod#role_IO
> >>
> >> chmod 0o755, ;
> >>
> >> Is it?
> >>   chmod 0o755, $file1, $file2
>
> On 06/03/2018 10:45 AM, Brandon Allbery wrote:
> > Yes, it's a quick way to mak a list of quoted strings. Think qw() in
> > perl 5, but < > is equivalent to single quotes whereas << >> is
> > equivalent to double quotes.
> >
>
> Sorry for being dense, but would you jot up an example?
>


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


Re: need mkdir, chown, chmod, del

2018-06-03 Thread ToddAndMargo

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

>
> Ah poop!  Can't find "chown"

On 06/03/2018 10:50 AM, Brandon Allbery wrote:
I imagine that'e because it's nearly impossible to implement portably: 
Unix and Windows do different things here. In particular, Unix chown() 
also sets the group owner, but Windows has no such concept.




A system call it is!

Thank you!


Re: need mkdir, chown, chmod, del

2018-06-03 Thread Brandon Allbery
I imagine that'e because it's nearly impossible to implement portably: Unix
and Windows do different things here. In particular, Unix chown() also sets
the group owner, but Windows has no such concept.

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

> On 06/03/2018 10:08 AM, ToddAndMargo wrote:
> >>> On Sun, Jun 3, 2018 at 1:05 PM ToddAndMargo  >>> > wrote:
> >>>
> >>> Hi All,
> >>>
> >>> I need the Perl6 commands for the following LINUX
> >>> commands.
> >>>
> >>> mkdir  make directory
> >>> chown  change ownership
> >>> chmod  change file mode bits
> >>> deldelete file
> >>>
> >>>
> >>> Many thanks,
> >>> -T
> >
> > On 06/03/2018 10:06 AM, Brandon Allbery wrote:
> >> Same answer: https://docs.perl6.org/type/IO::Path is where all the
> >> path-related things live.
> >
> > Thank you!
>
> Ah poop!  Can't find "chown"
>


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


Re: <> question

2018-06-03 Thread ToddAndMargo

https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E

On Sun, Jun 3, 2018 at 1:42 PM ToddAndMargo > wrote:


What is this?

https://docs.perl6.org/routine/chmod#role_IO

chmod 0o755, ;

Is it?
  chmod 0o755, $file1, $file2


On 06/03/2018 10:45 AM, Brandon Allbery wrote:
Yes, it's a quick way to mak a list of quoted strings. Think qw() in 
perl 5, but < > is equivalent to single quotes whereas << >> is 
equivalent to double quotes.




Sorry for being dense, but would you jot up an example?


Re: need mkdir, chown, chmod, del

2018-06-03 Thread ToddAndMargo

On 06/03/2018 10:08 AM, ToddAndMargo wrote:
On Sun, Jun 3, 2018 at 1:05 PM ToddAndMargo > wrote:


    Hi All,

    I need the Perl6 commands for the following LINUX
    commands.

    mkdir  make directory
    chown  change ownership
    chmod  change file mode bits
    del    delete file


    Many thanks,
    -T


On 06/03/2018 10:06 AM, Brandon Allbery wrote:
Same answer: https://docs.perl6.org/type/IO::Path is where all the 
path-related things live.


Thank you!


Ah poop!  Can't find "chown"


Re: <> question

2018-06-03 Thread Brandon Allbery
Yes, it's a quick way to mak a list of quoted strings. Think qw() in perl
5, but < > is equivalent to single quotes whereas << >> is equivalent to
double quotes.

https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E

On Sun, Jun 3, 2018 at 1:42 PM ToddAndMargo  wrote:

> What is this?
>
> https://docs.perl6.org/routine/chmod#role_IO
>
> chmod 0o755, ;
>
> Is it?
>  chmod 0o755, $file1, $file2
>


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


<> question

2018-06-03 Thread ToddAndMargo

What is this?

https://docs.perl6.org/routine/chmod#role_IO

chmod 0o755, ;

Is it?
chmod 0o755, $file1, $file2


Re: need mkdir, chown, chmod, del

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


Hi All,

I need the Perl6 commands for the following LINUX
commands.

mkdir  make directory
chown  change ownership
chmod  change file mode bits
deldelete file


Many thanks,
-T


On 06/03/2018 10:06 AM, Brandon Allbery wrote:
Same answer: https://docs.perl6.org/type/IO::Path is where all the 
path-related things live.


Thank you!


Re: need mkdir, chown, chmod, del

2018-06-03 Thread Brandon Allbery
Same answer: https://docs.perl6.org/type/IO::Path is where all the
path-related things live.

On Sun, Jun 3, 2018 at 1:05 PM ToddAndMargo  wrote:

> Hi All,
>
> I need the Perl6 commands for the following LINUX
> commands.
>
> mkdir  make directory
> chown  change ownership
> chmod  change file mode bits
> deldelete file
>
>
> Many thanks,
> -T
>
>
> --
> ~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~
>


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


Re: IO ???

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


Hi All,

I have a been looking around the docs pages and I am
not finding a list of what the various IO functions do.

I would like a list of IO.e does this and IO.d
does that.

Any such list exist?


Many thanks,
-T


On 06/03/2018 10:03 AM, Brandon Allbery wrote:
It's a bit subtle to track down, but the IO method gives you an IO::Path 
object. https://docs.perl6.org/type/IO::Path




I had found that, but I did not know what I was looking at.
Thank you!


need mkdir, chown, chmod, del

2018-06-03 Thread ToddAndMargo

Hi All,

I need the Perl6 commands for the following LINUX
commands.

mkdir  make directory
chown  change ownership
chmod  change file mode bits
deldelete file


Many thanks,
-T


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


Re: IO ???

2018-06-03 Thread Brandon Allbery
It's a bit subtle to track down, but the IO method gives you an IO::Path
object. https://docs.perl6.org/type/IO::Path

On Sun, Jun 3, 2018 at 1:01 PM ToddAndMargo  wrote:

> Hi All,
>
> I have a been looking around the docs pages and I am
> not finding a list of what the various IO functions do.
>
> I would like a list of IO.e does this and IO.d
> does that.
>
> Any such list exist?
>
>
> Many thanks,
> -T
>
>
> --
> ~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~
>


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


IO ???

2018-06-03 Thread ToddAndMargo

Hi All,

I have a been looking around the docs pages and I am
not finding a list of what the various IO functions do.

I would like a list of IO.e does this and IO.d
does that.

Any such list exist?


Many thanks,
-T


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