chown?

2017-09-28 Thread ToddAndMargo
Hi List, https://docs.perl6.org/language/5to6-perlfunc#chown say we ain't got a "chown" sub. Will this be coming to a theater neat us in the future? (I will use a system call till then.) -T

Re: chown?

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:03 PM, ToddAndMargo wrote: > https://docs.perl6.org/language/5to6-perlfunc#chown > > say we ain't got a "chown" sub. > > Will this be coming to a theater neat us in the future? > (I will use a system call till then.) > It's another of those things where a proper Window

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:35 PM, Brandon Allbery wrote: On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery > wrote: On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote:       method write(IO::Handle:D: Blob:D $buf --> True) The

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:05 AM, Brent Laabs wrote: OK, a method is something you call on an object, using a the dot operator.  A subroutine is an independent object installed into your current lexical scope. If write was a sub, it would work exactly as you described:    48:   my $Handle = open( $Date

Re: chown?

2017-09-28 Thread ToddAndMargo
On 09/28/2017 08:08 PM, Brandon Allbery wrote: On Thu, Sep 28, 2017 at 11:03 PM, ToddAndMargo > wrote: https://docs.perl6.org/language/5to6-perlfunc#chown say we ain't got a "chown" sub. Will th

Re: chown?

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:15 PM, ToddAndMargo wrote: > I wonder why they did not "banish" (sound so harsh) chmod? > Basic file permissions are actually relatively similar. Windows (and OS X! see chmod(1)) integrate ACL support, but there's still a reasonably common core that doesn't run into ke

Hash and subs question

2017-09-28 Thread ToddAndMargo
Hi All, Looking at this test I threw together; $ perl6 -e 'sub SayHash(%H) {say %H}; my %x = [aaa => "x", b=>"y", c=>"z"];SayHash(%x);' {aaa => x, b => y, c => z} I see that SayHash(%H) will take any hash I send it. Is there a way to make the compiler pissed if a sub does not see the specif

Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo wrote: > I see that SayHash(%H) will take any hash I send it. > > Is there a way to make the compiler pissed if a sub does not see > the specific keys int he hash it wants? Or do I need to use loop > with ":exists" and test each key? > You should b

Need MIME syntax help

2017-09-28 Thread ToddAndMargo
Hi All, This piece of code works: my $email = Email::MIME.create( header-str => [from => $from, to => @to, subject => $Subject ], parts => [ Email::MIME.create( header => [ content-transfer-encoding => "quoted-printable

Re: Hash and subs question

2017-09-28 Thread ToddAndMargo
On 09/28/2017 08:56 PM, Brandon Allbery wrote: On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo > wrote: I see that SayHash(%H) will take any hash I send it. Is there a way to make the compiler pissed if a sub does not see the specific keys int he hash it

Re: Hash and subs question

2017-09-28 Thread ToddAndMargo
On 09/28/2017 08:56 PM, Brandon Allbery wrote: On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo > wrote: I see that SayHash(%H) will take any hash I send it. Is there a way to make the compiler pissed if a sub does not see the specific keys int he hash it

Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo wrote: > sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) { > $x andthen $y andthen $z andthen True > } > > it turn my hash into single variables. Is there a way to > test if the right keys are present and keep my hash afterwards?

how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo
Hi All, I am creating a hash. One of the keys I want to point to an array, not a string. I have created a test: $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for @(%x) {say $_};' {aaa => x, b => [y q r], c => z} y q r This seems too easy. I have to have done somethin

Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:32 PM, ToddAndMargo wrote: Hi All, I am creating a hash.  One of the keys I want to point to an array, not a string. I have created a test: $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for @(%x) {say $_};' {aaa => x, b => [y q r], c => z} y q r This

-f ???

2017-09-28 Thread ToddAndMargo
Hi All, Does perl 6 have an equivalent to bash's "-f" to see if a file exists? Or is that a system call? Many thanks, -T

Re: Hash and subs question

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:11 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo > wrote: sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) {     $x andthen $y andthen $z andthen True } it turn my hash into single variable

Re: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:32 AM, ToddAndMargo wrote: > $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for > @(%x) {say $_};' > {aaa => x, b => [y q r], c => z} > y > q > r > > This seems too easy. I have to have done something wrong. > What did I miss? > Only that it's ev

Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:43 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:32 AM, ToddAndMargo > wrote: $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for @(%x) {say $_};' {aaa => x, b => [y q r], c => z} y q r This

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo wrote: > Does perl 6 have an equivalent to bash's "-f" to > see if a file exists? Or is that a system call? > IO::Path's .f method. (Or .e to not require it to be a file, etc. as usual.) pyanfar Z$ 6 '".profile".IO.f.say' True -- brandon

Re: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:44 AM, ToddAndMargo wrote: > I will probably use the @ for a while until I get use to > it for readability. > I think that's actually disrecommended, because it looks too much like Perl 5's refs but isn't, so it can bite you unexpectedly if you treat it like one. --

Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:47 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:44 AM, ToddAndMargo > wrote: I will probably use the @ for a while until I get use to it for readability. I think that's actually disrecommended, because it looks too much like Perl

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:45 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo > wrote: Does perl 6 have an equivalent to bash's "-f" to see if a file exists?  Or is that a system call? IO::Path's .f method. (Or .e to not require it to be a

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:53 PM, ToddAndMargo wrote: On 09/28/2017 09:45 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo > wrote:     Does perl 6 have an equivalent to bash's "-f" to     see if a file exists?  Or is that a system call? IO::Path's

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo wrote: > On 09/28/2017 09:53 PM, ToddAndMargo wrote: > >> On 09/28/2017 09:45 PM, Brandon Allbery wrote: >> >>> IO::Path's .f method. (Or .e to not require it to be a file, etc. as >>> usual.) >>> >>> pyanfar Z$ 6 '".profile".IO.f.say' >>>

Re: -f ???

2017-09-28 Thread Norman Gaywood
I was just reading about this! On 29 September 2017 at 14:53, ToddAndMargo wrote: > > $ perl6 -e 'say "erasxeme.txt".IO.f;' > Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f' > in block at -e line 1 > When you do: "erasxeme.txt".IO.f It will fail (before the .f even)

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 09:53 PM, ToddAndMargo wrote: On 09/28/2017 09:45 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo > wrote:     Does perl 6 have an equivalent to bash's "-f" to     see if a file exists?  Or is that a system call? IO::Path's

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:06 AM, Brandon Allbery wrote: > On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo > wrote: > >> On 09/28/2017 09:53 PM, ToddAndMargo wrote: >> >>> On 09/28/2017 09:45 PM, Brandon Allbery wrote: >>> IO::Path's .f method. (Or .e to not require it to be a file, etc. as >

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo wrote: > Figured it out. The chat line told me that there is an error in the > docs. The proper way was "e" not "f" > This is not the same thing. .e will return True if it exists but is a directory, for example. I mentioned this in my first respons

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 10:12 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote: Figured it out.  The chat line told me that there is an error in the docs.  The proper way was "e" not "f" This is not the same thing. .e will return True

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:10 AM, Brandon Allbery wrote: > Apparently not a bug, just unfortunate. You have to explicitly coerce it > to Bool to keep it from throwing. > > pyanfar Z$ 6 '".profileX".IO.f.Bool.say' > False > This can also be done with 'so' or prefix '?'. pyanfar Z$ 6 '

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 10:19 PM, ToddAndMargo wrote: On 09/28/2017 10:12 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote:     Figured it out.  The chat line told me that there is an error in the     docs.  The proper way was "e" not "f" Th

Re: -f ???

2017-09-28 Thread ToddAndMargo
On 09/28/2017 10:31 PM, ToddAndMargo wrote: On 09/28/2017 10:19 PM, ToddAndMargo wrote: On 09/28/2017 10:12 PM, Brandon Allbery wrote: On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote:     Figured it out.  The chat line told me that there is an error in the  

Re: -f ???

2017-09-28 Thread Norman Gaywood
On 29 September 2017 at 15:10, Brandon Allbery wrote: > > (And, Norman? It produces a Failure, not a hard exception. You can > introspect Failures to keep them from getting thrown.) > Yep, that's what I thought I'd said :-) Obviously not clearly. Another way of looking at it: $ perl6 -e 'my $

Re: -f ???

2017-09-28 Thread Simon Proctor
So $f = so "eraseme.txt".IO.f; Would do the trick? On Fri, 29 Sep 2017, 6:56 am Norman Gaywood, wrote: > On 29 September 2017 at 15:10, Brandon Allbery > wrote: > >> >> (And, Norman? It produces a Failure, not a hard exception. You can >> introspect Failures to keep them from getting thrown.)

write bytes requires an object with REPR MVMOSHandle

2017-09-28 Thread ToddAndMargo
Hi All, I am stumped. This only screws up in the for loop. This is only the chopped up version #!/usr/bin/env perl6 my $SmtpIniFileName = $?FILE ~ ".ini"; my %SmtpIni = [ 'DebugTrace' => "", # 1 | 0 (-vvv) 'smtp' => "", # smtp.zoho.com 'po