Re: I need help with .IO.d.Bool

2025-04-06 Thread ToddAndMargo via perl6-users
On 4/5/25 6:58 PM, ToddAndMargo via perl6-users wrote: sub Directory I changed the name to DirectoryExists The new name is more human friendly

Re: I need help with .IO.d.Bool

2025-04-05 Thread ToddAndMargo via perl6-users
On 4/2/25 6:08 PM, Bruce Gray wrote: On Apr 2, 2025, at 19:47, ToddAndMargo via perl6-users wrote: --snip-- raku -e "say '\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1'.IO.d.Bool;" False --snip-- Moving this one-liner into a .raku file (to remove the complication of Wi

Re: I need help with .IO.d.Bool

2025-04-05 Thread Bruce Gray
> On Apr 2, 2025, at 19:47, ToddAndMargo via perl6-users > wrote: --snip-- > raku -e "say > '\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1'.IO.d.Bool;" > False --snip-- Moving this one-liner into a .raku file (to remove the complication of Windows needing double-quotes for o

Re: I need help with get-options

2025-04-02 Thread ToddAndMargo via perl6-users
On 4/2/25 8:22 AM, Bruce Gray wrote: my $CommandLine = CommandLineClass.new{    help   => False,    debug  => False,    UNC_BackupPath => Q[\\192.168.240.10\MyDocsBackup\backup1],    rotates    => 2,    ParentDir  => "/" }; The problem is with the syntax of the `new`. Y

Re: I need help with .IO.d.Bool

2025-04-02 Thread ToddAndMargo via perl6-users
On 4/2/25 9:53 PM, ToddAndMargo via perl6-users wrote: On 4/2/25 6:26 PM, Will Coleda wrote: Try printing the Str before you do anything with it to see what happens. I moved to powershell I mean I did a call to powershell to find if a directory existed

Re: I need help with .IO.d.Bool

2025-04-02 Thread Will Coleda
Try printing the Str before you do anything with it to see what happens. (Hint - the backslash character escapes characters in literal strings) On Wed, Apr 2, 2025 at 8:47 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Windows Server 2025 (souped up W11) > > raku -v

Re: I need help with .IO.d.Bool

2025-04-02 Thread ToddAndMargo via perl6-users
On 4/2/25 6:26 PM, Will Coleda wrote: Try printing the Str before you do anything with it to see what happens. I moved to powershell

Re: I need help with .IO.d.Bool

2025-04-02 Thread ToddAndMargo via perl6-users
On 4/2/25 6:08 PM, Bruce Gray wrote: On Apr 2, 2025, at 19:47, ToddAndMargo via perl6-users wrote: --snip-- raku -e "say '\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1'.IO.d.Bool;" False --snip-- Moving this one-liner into a .raku file (to remove the complication of Wi

I need help with .IO.d.Bool

2025-04-02 Thread ToddAndMargo via perl6-users
Hi All, Windows Server 2025 (souped up W11) raku -v Welcome to RakudoΓäó v2025.02. I am trying to see if this directory exists: \\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1 This is what raku .IO.d.Bool give me: raku -e "say '\\192.168.240.10\oldserver\Backup\MyDocsBackup\back

Re: I need help with get-options

2025-04-02 Thread Bruce Gray
> On Apr 2, 2025, at 05:47, ToddAndMargo via perl6-users > wrote: --snip-- > Hi Bruce, > > Sorry. I do know I am suppose to post some minimal code. > I was programming for 11 straight hours and was not > thinking too clearly. I understand. > I was trying to do what you said. Read it into

Re: I need help with get-options

2025-04-02 Thread ToddAndMargo via perl6-users
On 4/1/25 4:04 PM, Bruce Gray wrote: On Apr 1, 2025, at 03:55, ToddAndMargo via perl6-users wrote: --snip-- I have the following run string: raku C:\NtUtil\RLA.Backup.raku --rotates 345 --UNC_BackupPath \\192.168.240.10\Backup\MyDocsBackup\backup1 --debug use Getopt::Long; # get-opti

Re: I need help with get-options

2025-04-01 Thread Bruce Gray
> On Apr 1, 2025, at 03:55, ToddAndMargo via perl6-users > wrote: --snip-- > I have the following run string: > raku C:\NtUtil\RLA.Backup.raku --rotates 345 --UNC_BackupPath > \\192.168.240.10\Backup\MyDocsBackup\backup1 --debug > > > use Getopt::Long; # get-options > get-options('debug'

I need help with

2025-04-01 Thread ToddAndMargo via perl6-users
Hi All, Windows Server 2025 (souped up W11) raku -v Welcome to Rakudo™ v2025.02. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2025.02. https://raku.land/cpan:LEONT/Getopt::Long I have the following run string: raku C:\NtUtil\RLA.Backup.raku --rotates 345 --UNC_

Re: I need help with get-options

2025-04-01 Thread ToddAndMargo via perl6-users
Should have said "I need help with get-options"

Re: I need help with ~~m/

2021-01-30 Thread Patrick R. Michaud
On Sat, Jan 30, 2021 at 05:52:54PM -0800, Joseph Brenner wrote: > Which means there's some potential confusion if you really need > to match quotes: > > my $str = 'string_632="The chicken says--", voice="high"'; > > say > $str ~~ m:g{ ( " .*? " ) }; # False > say > $str

Re: I need help with ~~m/

2021-01-30 Thread ToddAndMargo via perl6-users
On 1/30/21 5:52 PM, Joseph Brenner wrote: I think ToddAndMargo was thinking of perl5 regexes, where [.] is a good way of matching a literal dot-- though myself, I'm more inclined to use \. In Raku, the square brackets just do non-capturing grouping much like (?: ... } in perl5. To do a characte

Re: I need help with ~~m/

2021-01-30 Thread Joseph Brenner
> My mistake was think that if a value at the end > did not exist, I was given back a null. Now I know > to look for a false. > > say "1.33" ~~ m/(\d+) ** 3..4 % "." / > False That pattern says there has to be three or four fields of digits, so if you don't have that many, the entire match has t

Re: I need help with ~~m/

2021-01-30 Thread Joseph Brenner
I think ToddAndMargo was thinking of perl5 regexes, where [.] is a good way of matching a literal dot-- though myself, I'm more inclined to use \. In Raku, the square brackets just do non-capturing grouping much like (?: ... } in perl5. To do a character class, you need angles around the squares.

Re: I need help with ~~m/

2021-01-30 Thread ToddAndMargo via perl6-users
On 1/30/21 1:03 AM, William Michels via perl6-users wrote: Hi Todd (and JJ), On Fri, Jan 29, 2021 at 11:58 PM JJ Merelo wrote: El sáb, 30 ene 2021 a las 7:24, ToddAndMargo via perl6-users () escribió: Hi All, rakudo-pkg-2020.12-01.x86_64 Why does this work? > $x = "1.33.222.4"; 1.33

Re: I need help with ~~m/

2021-01-30 Thread William Michels via perl6-users
Hi Todd (and JJ), On Fri, Jan 29, 2021 at 11:58 PM JJ Merelo wrote: > > > > El sáb, 30 ene 2021 a las 7:24, ToddAndMargo via perl6-users > () escribió: >> >> Hi All, >> >> rakudo-pkg-2020.12-01.x86_64 >> >> Why does this work? >> >> > $x = "1.33.222.4"; >> 1.33.222.4 >> > $x ~~ m/ (<:N>+) [.]

Re: I need help with ~~m/

2021-01-29 Thread JJ Merelo
El sáb, 30 ene 2021 a las 7:24, ToddAndMargo via perl6-users (< perl6-us...@perl.org>) escribió: > Hi All, > > rakudo-pkg-2020.12-01.x86_64 > > Why does this work? > > > $x = "1.33.222.4"; > 1.33.222.4 > > $x ~~ m/ (<:N>+) [.] (<:N>+) [.] (<:N>+) [.] (<:N>+) /; > 「1.33.222.4」 > 0 => 「1」 > 1

I need help with ~~m/

2021-01-29 Thread ToddAndMargo via perl6-users
Hi All, rakudo-pkg-2020.12-01.x86_64 Why does this work? > $x = "1.33.222.4"; 1.33.222.4 > $x ~~ m/ (<:N>+) [.] (<:N>+) [.] (<:N>+) [.] (<:N>+) /; 「1.33.222.4」 0 => 「1」 1 => 「33」 2 => 「222」 3 => 「4」 But this does not? --> Why the wrong number in $2? --> Why no Nil for $3? > $x = "

Re: I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 10:11 AM, Bruce Gray wrote: $a + $b - $c * $d / $e.foo , the .foo method is called on $e, not on the whole A-through-E sub-expression. That makes sense. It is the precidence. In college, we called it "algebraic operation". ** came before *; * came before +; etc In Raku, a m

Re: I need help with cosine and ()

2020-12-20 Thread Bruce Gray
> On Dec 20, 2020, at 6:08 AM, ToddAndMargo via perl6-users > wrote: > >>> On Sun, Dec 20, 2020 at 02:05 ToddAndMargo via perl6-users >>> mailto:perl6-us...@perl.org>> wrote: >>>Hi All, >>>Why does this work? >>> say (45*π/180).cos >>> 0.7071067811865476 >>>And

Re: I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
On Sun, Dec 20, 2020 at 02:05 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Why does this work? say (45*π/180).cos 0.7071067811865476 And this not? say 45*π/180.cos -236.22573454917193 Is not the math suppose

I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, Why does this work? say (45*π/180).cos 0.7071067811865476 And this not? say 45*π/180.cos -236.22573454917193 Is not the math suppose to be done first? Confused again, -T

Re: I need help with Config:INI

2020-05-30 Thread ToddAndMargo via perl6-users
On 2020-05-30 20:08, ToddAndMargo via perl6-users wrote: Follow up. I just opened An Example to consider adding to your documentation: https://github.com/tadzik/perl6-Config-INI/issues/17

Re: I need help with Config:INI

2020-05-30 Thread ToddAndMargo via perl6-users
Follow up. Special thanks to Peter and David! I wrote a sample program to explain things in my personal documentation: -T Raku: reading INI files: Example: ~ini.test.pl6.ini ~~~ # Raku: Config::INI test INI # edit at your own risk IHave=NoSection [Backup paramters] target

Re: I need help with Config:INI

2020-05-30 Thread Peter Pentchev
On Fri, May 29, 2020 at 05:02:15PM -0700, ToddAndMargo via perl6-users wrote: > Hi All, > > I an not figure out how to read the hash. > > > ~~~ ini.test.pl6.ini ~ > # Raku: Confug::INI test INI > # edit at your own risk > > [Backup paramters] > target=B:\myDocsBackp\backup1

Re: I need help with Config:INI

2020-05-30 Thread David Santiago
Hope this helps :-) Basically the %hash variable contains another hash, and with spaces in keys you cannot use them with "<>" use Config; use Config::INI; my Str $IniFile = slurp "config.ini"; my %hash = Config::INI::parse($IniFile); dd %hash; print "\n"; for %hash.kv -> $section_name, %secti

I need help with Config:INI

2020-05-29 Thread ToddAndMargo via perl6-users
Hi All, I an not figure out how to read the hash. ~~~ ini.test.pl6.ini ~ # Raku: Confug::INI test INI # edit at your own risk [Backup paramters] target=B:\myDocsBackp\backup1 partition=BACKUP [eMail] smtp=smtp.bozo.com address=b...@theclown.com port=587 ~~~ /ini.te

Re: I need help with IO.e

2020-05-22 Thread ToddAndMargo via perl6-users
On 2020-05-19 05:17, Peter Pentchev wrote: ...control structures, I mean. G'luck, Peter No problem, I appreciate all the help! :-) -T

Re: I need help with IO.e

2020-05-19 Thread Peter Pentchev
On Tue, May 19, 2020 at 03:16:41PM +0300, Peter Pentchev wrote: > On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wrote: > > On 2020-05-18 17:14, Peter Pentchev wrote: > > > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users > > > wrote: > > > > In 2020-0

Re: I need help with IO.e

2020-05-19 Thread Peter Pentchev
On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 17:14, Peter Pentchev wrote: > > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users > > wrote: > > > In 2020-05-18 16:11, Peter Pentchev wrote: > > > > As an exercise for the reader: o

Re: I need help with IO.e

2020-05-19 Thread Tom Browder
On Tue, May 19, 2020 at 03:44 Richard Hainsworth wrote: > The transcendental abundance of purple in Raku :) Ah, Richard, thanks for a trip down memory lane! In my youth I discovered the joys of science fiction a few years after that piece was published. -Tom

Re: I need help with IO.e

2020-05-19 Thread Richard Hainsworth
Peter, What a genius answer! The transcendental abundance of purple in Raku :) On 18/05/2020 22:26, Peter Pentchev wrote: It's the internal representation of the program you told Raku to parse and execute; the truth is that, just like in a sci-fi story about a machine that is supposed to answ

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 22:58, ToddAndMargo via perl6-users wrote: On 2020-05-18 17:14, Peter Pentchev wrote: On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly will

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 17:14, Peter Pentchev wrote: On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly will "say if 'h:/'.IO.d" do? It returns the the result of th

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: > In 2020-05-18 16:11, Peter Pentchev wrote: > > As an exercise for the reader: once the above sinks in, what exactly > > will "say if 'h:/'.IO.d" do? > > It returns the the result of the expression that > "if" evaluated

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly will "say if 'h:/'.IO.d" do? It returns the the result of the expression that "if" evaluated. I do know all this. It is easier for me to read the other way.

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 16:01, Tom Browder wrote: Since you don't like to listen to advice I give up. Tom! I listen to your advice ALL-THE-TIME. I was just interested in something else. And when I did not understand the result, your way or my way, I abandoned the effort, especially since I did not nee

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 03:51:30PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 15:44, Tom Browder wrote: > > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users > > mailto:perl6-us...@perl.org>> wrote: > > > > On 2020-05-18 13:28, Tom Browder wrote: > > > > ... > > > >

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 17:51 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-18 15:44, Tom Browder wrote: > > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users > > mailto:perl6-us...@perl.org>> wrote: > > > > On 2020-05-18 13:28, Tom Browder wrote: > > > > ..

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 15:44, Tom Browder wrote: On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-05-18 13:28, Tom Browder wrote: ... > Try: > > 'say so "test".IO.d' Todd, you didn't try what I suggested. Once again, look a th

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-18 13:28, Tom Browder wrote: ... > > Try: > > > > 'say so "test".IO.d' Todd, you didn't try what I suggested. Once again, look a the line above^^ There is no "if" there. -Tom

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 15:38, Peter Pentchev wrote: On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-18 14:35, Peter Pentchev wrote: My point is that you put a bare "say" without telling it*what* to say, which does something quite specific in both Perl and Raku.

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 14:35, Peter Pentchev wrote: > > My point is that you put a bare "say" without telling it*what* to say, > > which does something quite specific in both Perl and Raku. That should, > > at least, explain th

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 14:35, Peter Pentchev wrote: My point is that you put a bare "say" without telling it*what* to say, which does something quite specific in both Perl and Raku. That should, at least, explain the error-like message. G'luck, Peter What I was after was to see what impact I had coerc

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 02:32:49PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 14:22, Peter Pentchev wrote: > > Please note that in my example a couple of messages ago I did not write > > "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference > > is very important and

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 14:22, Peter Pentchev wrote: Please note that in my example a couple of messages ago I did not write "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference is very important and leads directly to the error-like message you got. Hi Peter, I as interested in the .d

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Tue, May 19, 2020 at 12:22:55AM +0300, Peter Pentchev wrote: > On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wrote: > > On 2020-05-17 22:28, Paul Procacci wrote: > > > Don't 'say' anything.  Just let the optimizer spit out the QAST that you > > > are interested in lookin

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 22:28, Paul Procacci wrote: > > Don't 'say' anything.  Just let the optimizer spit out the QAST that you > > are interested in looking at. > > The following spits out a diff after optimization: > > > > #

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 13:28, Tom Browder wrote: On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-05-17 22:28, Paul Procacci wrote: ... 'say if "test".IO.d',  and 'say "test".IO.d.Bool' Try: 'say so "test".IO.d' I have mo clue th

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 22:28, Paul Procacci wrote: ... > 'say if "test".IO.d', and > 'say "test".IO.d.Bool' Try: 'say so "test".IO.d'

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-17 22:28, Paul Procacci wrote: Don't 'say' anything.  Just let the optimizer spit out the QAST that you are interested in looking at. The following spits out a diff after optimization: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bo

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
Don't 'say' anything. Just let the optimizer spit out the QAST that you are interested in looking at. The following spits out a diff after optimization: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') >> Huh. Not sure what I am looking at

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 21:48, Paul Procacci wrote: You can check this yourself by looking at the QAST nodes after the static analyzer has had its fill: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') Huh. Not sure what I am looking at $ diff -

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
You can check this yourself by looking at the QAST nodes after the static analyzer has had its fill: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') On Mon, May 18, 2020 at 12:25 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote:

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 21:19, ToddAndMargo via perl6-users wrote: On 2020-05-17 20:28, Paul Procacci wrote: So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) Hi Paul, Especially when I can ne

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 20:28, Paul Procacci wrote: So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) Hi Paul, Especially when I can never remember when IO.someletter will return a full True or

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) On Sun, May 17, 2020 at 6:10 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 14:43, ToddAndMargo via perl6-

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 14:43, ToddAndMargo via perl6-users wrote: Although    "say 'yes' if 'h:/'.IO.d" is obscure to me and    "say 'h:/'.IO.d.Bool" is very easy for me to understand. Hi Peter, I think it would help if you knew how my mind worked. `if` to me is a Boolean function. If this exp

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 13:04, Peter Pentchev wrote: On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 03:36, Peter Pentchev wrote: On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 02:30, Peter Pentchev wrote: You said

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 03:36, Peter Pentchev wrote: > > On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-17 02:30, Peter Pentchev wrote: > > > > You said that you would tack Boo

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 03:50, Elizabeth Mattijsen wrote: [11:50:21]you don.t need the .Bool, .e already returns a Bool [11:53:07] sometimes IO.someletter returns True of Fail, not False. Tacking .Bool on the end, means I don't have to remember which ones [11:57:23] True or Fail. Typo [11:58:2

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 03:36, Peter Pentchev wrote: On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 02:30, Peter Pentchev wrote: You said that you would tack Bool at the end in "if" statements, too. Hi Peter, No wonder. I do not remember saying that, but I

Re: I need help with IO.e

2020-05-17 Thread Elizabeth Mattijsen
[11:50:21] you don.t need the .Bool, .e already returns a Bool [11:53:07]sometimes IO.someletter returns True of Fail, not False. Tacking .Bool on the end, means I don't have to remember which ones [11:57:23]True or Fail. Typo [11:58:21] A Failure is always false [12:03

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 02:30, Peter Pentchev wrote: > > You said that you would tack Bool at the end in "if" statements, too. > > Hi Peter, > > No wonder. I do not remember saying that, but I could > have. My `if` statements

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 02:30, Peter Pentchev wrote: You said that you would tack Bool at the end in "if" statements, too. Hi Peter, No wonder. I do not remember saying that, but I could have. My `if` statements look like: if not "%Options".IO.d.Bool { say "Creating %Options"; mkdir(

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 02:18:30AM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 01:23, Peter Pentchev wrote: > > On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-16 17:44, Peter Pentchev wrote: > > > > On Sat, May 16, 2020 at 03:19:05

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 01:23, Peter Pentchev wrote: On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 17:44, Peter Pentchev wrote: On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 06:38, Peter Pentchev wrote: $ raku *

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-16 17:44, Peter Pentchev wrote: > > On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-16 06:38, Peter Pentchev wrote: > > > > > $ raku *-e* "your one-liner sc

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 17:44, Peter Pentchev wrote: On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 06:38, Peter Pentchev wrote: $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those a

Re: I need help with IO.e

2020-05-16 Thread Peter Pentchev
On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-16 06:38, Peter Pentchev wrote: > > > $ raku *-e* "your one-liner script here" > > And also you might want to put some quotes around the paths to let Raku > > know that those are strings and not some identifi

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 06:38, Peter Pentchev wrote: $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those are strings and not some identifiers or something. G'luck, Peter Hi Peter, This is what goofed me up: $ alias p5 alias

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 05:34, Kevin Pye wrote: The documentation for .d states: Returns |True| if the invocant is a path that exists and is a directory. The method will |fail|  with |X::IO::DoesNotExist| if the path points to a non-existent filesystem entity. (and

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
> Le sam. 16 mai 2020 à 12:16, ToddAndMargo via perl6-users > mailto:perl6-us...@perl.org>> a écrit : > > On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: > > Hi All,. > > > > Windows 7, sp1, x64 > > > > >raku -v > > This is Rakudo version 2020.01 built o

Re: I need help with IO.e

2020-05-16 Thread Peter Pentchev
On Sat, May 16, 2020 at 01:29:12PM +0200, Laurent Rosenfeld via perl6-users wrote: > Hi, > > it should be: > > $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those are strings and not some identifiers or something. G'l

Re: I need help with IO.e

2020-05-16 Thread Kevin Pye
There are three possibilities for the.d test -- the file exists and is a directory, the files exists and is not a directory, and the file does not exist. The test needs to distinguish between these three cases. The documentation for .d states: Returns True if the invocant is a path that exists an

Re: I need help with IO.e

2020-05-16 Thread Laurent Rosenfeld via perl6-users
Hi, it should be: $ raku *-e* "your one-liner script here" Best regards, Laurent. Le sam. 16 mai 2020 à 12:16, ToddAndMargo via perl6-users < perl6-us...@perl.org> a écrit : > On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: > > Hi All,. > > > > Windows 7, sp1, x64 > > > > >raku -v >

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: Hi All,. Windows 7, sp1, x64 >raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am trying to get perl to tell me if a drive letter exists This is from Git's df command: >df -kPT H:\ Fi

I need help with IO.e

2020-05-15 Thread ToddAndMargo via perl6-users
Hi All,. Windows 7, sp1, x64 >raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am trying to get perl to tell me if a drive letter exists This is from Git's df command: >df -kPT H:\ Filesystem Type 1024-blocks Used Available Capacity Mount

Re: I need help with sub MAIN

2020-05-10 Thread ToddAndMargo via perl6-users
On 2020-05-05 12:28, yary wrote: Oops my example was missing the important $*USAGE message. And it makes sense to show the wrong named args before the wrong list args. example.raku:   multi sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; };   multi sub MAIN(*@wrong-list,:$these =

Re: I need help with sub MAIN

2020-05-05 Thread yary
Oops my example was missing the important $*USAGE message. And it makes sense to show the wrong named args before the wrong list args. example.raku: multi sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; }; multi sub MAIN(*@wrong-list,:$these ="These", :$are="Are",*%wrong-named) is

Re: I need help with sub MAIN

2020-05-05 Thread yary
Here's something to play with (without explanation from me, busy enough sorry!) example.raku: multi sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; }; multi sub MAIN(*@wrong-list,:$these ="These", :$are="Are",*%wrong-named) is hidden-from-USAGE {say "Got bad args " ~ @wrong-l

Re: I need help with sub MAIN

2020-05-05 Thread ToddAndMargo via perl6-users
On Tue, 5 May 2020, 06:46 ToddAndMargo via perl6-users, mailto:perl6-us...@perl.org>> wrote: Hi All, Just to prove I read the stinker: https://docs.raku.org/routine/MAIN I am trying to get the following to do #!/usr/bin/env perl6 sub MAIN(:$these ="These", :$are="Are")

Re: I need help with sub MAIN

2020-05-05 Thread Simon Proctor
I would suggest starting by reading this page in the docs : https://docs.raku.org/language/create-cli Covers how $*USAGE is created and the various options you have for providing help data. On Tue, 5 May 2020, 06:46 ToddAndMargo via perl6-users, < perl6-us...@perl.org> wrote: > Hi All, > > Just

I need help with sub MAIN

2020-05-04 Thread ToddAndMargo via perl6-users
Hi All, Just to prove I read the stinker: https://docs.raku.org/routine/MAIN I am trying to get the following to do #!/usr/bin/env perl6 sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; } This is working: $ MainTest.pl6 --are=our --these=those those our These two are not: 1) I

Re: I need help with the copy command

2020-05-01 Thread ToddAndMargo via perl6-users
On Fri, May 1, 2020 at 11:40 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, https://docs.perl6.org/routine/copy (IO::Path) routine copy Defined as: method copy(IO::Path:D: IO() $to, :$createonly --> Bool:D) sub

Re: I need help with the copy command

2020-05-01 Thread Paul Procacci
$createonly fails to do a copy when the destination file already exists. An example of shell commands to emulate this is: # echo a > test1 # echo b > test2 # cp -n test2 test1 # cat test1 a As for recursion...you probably need to write a recursive function somewhere (didn't look that hard). On F

I need help with the copy command

2020-05-01 Thread ToddAndMargo via perl6-users
Hi All, https://docs.perl6.org/routine/copy (IO::Path) routine copy Defined as: method copy(IO::Path:D: IO() $to, :$createonly --> Bool:D) subcopy(IO() $from, IO() $to, :$createonly --> Bool:D) Copies a file. Returns True on success; fails with X::IO::Copy if :$cre

Re: I need help with "lines"

2019-03-16 Thread ToddAndMargo via perl6-users
On 3/15/19 6:38 PM, ToddAndMargo via perl6-users wrote: On 3/14/19 10:05 PM, Todd Chester via perl6-users wrote: Hi All, What am I doing wrong here? ps ax | grep [f]irefox | perl6 -ne 'my @x = $_.words[0].lines.reverse; print @x[0] ~ "\n";' 7380 7581 7698 13023 13767 13908 Two problems: 1

Re: I need help with "lines"

2019-03-15 Thread ToddAndMargo via perl6-users
On 3/14/19 10:05 PM, Todd Chester via perl6-users wrote: Hi All, What am I doing wrong here? ps ax | grep [f]irefox | perl6 -ne 'my @x = $_.words[0].lines.reverse; print @x[0] ~ "\n";' 7380 7581 7698 13023 13767 13908 Two problems: 1) "lines" is putting everything into @x[0] 2) "reverse"

Re: I need help with "lines"

2019-03-15 Thread Todd Chester via perl6-users
On 3/15/19 7:58 AM, Todd Chester via perl6-users wrote: Never did figure out why everything went into @x[0] The entire pipe gets put into @x[0]. @x[1] is uninitialized

Re: I need help with "lines"

2019-03-15 Thread Peter Pentchev
On Fri, Mar 15, 2019 at 07:52:57AM -0700, Todd Chester via perl6-users wrote: > > > On 3/15/19 2:52 AM, Peter Pentchev wrote: > > 1. Learn to use pgrep instead of the myriad variations of ps | grep; > > pgrep has been standardized by POSIX for a long time and is almost > > certainly avail

Re: I need help with "lines"

2019-03-15 Thread Peter Pentchev
On Fri, Mar 15, 2019 at 07:58:11AM -0700, Todd Chester via perl6-users wrote: > > > On 3/15/19 3:02 AM, Peter Pentchev wrote: > > On Fri, Mar 15, 2019 at 11:52:15AM +0200, Peter Pentchev wrote: > > [snip] > > > 3. The standard input stream in Perl 6 is called $*IN (think of it as > > > mostly

Re: I need help with "lines"

2019-03-15 Thread Todd Chester via perl6-users
On 3/15/19 3:02 AM, Peter Pentchev wrote: On Fri, Mar 15, 2019 at 11:52:15AM +0200, Peter Pentchev wrote: [snip] 3. The standard input stream in Perl 6 is called $*IN (think of it as mostly equivalent to what <<>> and <> would read from in Perl 5, ...sorry about this part, I know it's n

Re: I need help with "lines"

2019-03-15 Thread Todd Chester via perl6-users
On 3/15/19 2:52 AM, Peter Pentchev wrote: Hope that helped! G'luck, Peter [1] The "almost certainly" is because, yes, yes, I know, I also have that dusty old HP/UX crunching away in a customer's basement; still. Yes it does. Thank you! I remember zsh for my Solaris days. Or at leas

Re: I need help with "lines"

2019-03-15 Thread Todd Chester via perl6-users
On 3/15/19 2:52 AM, Peter Pentchev wrote: 1. Learn to use pgrep instead of the myriad variations of ps | grep; pgrep has been standardized by POSIX for a long time and is almost certainly available in all the installations that you will ever need to touch[1]. pgrep is interesting

Re: I need help with "lines"

2019-03-15 Thread Todd Chester via perl6-users
On 3/15/19 2:35 AM, Simon Proctor wrote: All looking good so far. what is it you're wanting from this data? Hi Simon, Thank you! What this is for is a backup routine. I am checking for the highest instance of any jammed running instances of [xfa]dump. If I find any, I "kill -9" it and wa

  1   2   >