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
se { return False; } } Notice that I did not have to mess the `$DriveDirectory`? .IO.d.Bool needs to do the same. Let me know if you want the code for `RunCmd`. Thank you for the help, -T

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 wi

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
what you said. Read it into a hash, then > extract the values into an OOP structure.(I use to like > hashes, but dropped them hard when I figured out OOP > structures. I absolutely A-D-O-R-E OOP structures.) > > Thank you again for the help! > -T --snip-- > my $

Re: I need help with get-options

2025-04-02 Thread ToddAndMargo via perl6-users
ou said. Read it into a hash, then extract the values into an OOP structure.(I use to like hashes, but dropped them hard when I figured out OOP structures. I absolutely A-D-O-R-E OOP structures.) Thank you again for the help! -T Windows Server 2025 (souped up W11) raku -v Welcome to Rak

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 understanding a match

2025-01-16 Thread ToddAndMargo via perl6-users
On 1/16/25 1:41 AM, Todd Chester via perl6-users wrote: First I should apologize for one of my earlier posts. The first token was a bit of a jumble. I think now you just want the literal string "download" to start your capture. Hi Bill, Don't apologize. You are teaching me at trans light spe

Re: I need help understanding a match

2025-01-16 Thread Todd Chester via perl6-users
gt; say $a ~~ m/ Y /; 「Y」 Try reading that out loud in English, "say $a smartmatching against a requested `m` match comprising after-X, Y, before-Z". If you read it that way, you'll understand why only the `「Y」` ends up in the match variable. You can also `andthen` the smartmat

Re: I need help understanding a match

2025-01-13 Thread William Michels via perl6-users
sh, "say $a smartmatching against a requested `m` match comprising after-X, Y, before-Z". If you read it that way, you'll understand why only the `「Y」` ends up in the match variable. You can also `andthen` the smartmatch, which will put the match in the `$_` topic variable for y

Re: I need help understanding a match

2025-01-12 Thread ToddAndMargo via perl6-users
On 1/12/25 3:11 AM, ToddAndMargo via perl6-users wrote: `?download ^`   # positive look-behind, match but don`t capture `download `   # `^` means "look behind" Opps, that should be: `?before ^` # positive look-behind, match but don`t capture `download ` # `^` m

Re: I need help understanding a match

2025-01-12 Thread ToddAndMargo via perl6-users
Hi Bill, Please correct my notes. Many thanks, -T Explanation: my @y = $x ~~ m:g/ .*? | \h+ > /; `m:g` # match and global `\...\` # the constrains (beginning and end) of the match `<...>` # constraints of instructions inside the match First instruction: `` `?download ^` # p

Re: I need help understanding a match

2025-01-12 Thread ToddAndMargo via perl6-users
On 1/12/25 12:59 AM, William Michels via perl6-users wrote: ~$ /Users/admin/rakudo/rakudo-2024.09/rakudo-moar-2024.09-01-macos- arm64-clang/bin/raku -e '  \    my Str $AltClickHere = lines[0];  \    my @AltArray =       ($AltClickHere ~~ m:g/           download        #literal           .*?

Re: I need help understanding a match

2025-01-12 Thread William Michels via perl6-users
~$ /Users/admin/rakudo/rakudo-2024.09/rakudo-moar-2024.09-01-macos-arm64-clang/bin/raku -e ' \ my Str $AltClickHere = lines[0]; \ my @AltArray = ($AltClickHere ~~ m:g/ download#literal .*? #any-character, one-or-more, frugal > #po

I need help understanding a match

2025-01-11 Thread ToddAndMargo via perl6-users
Hi All, In another post, Bill gave me a wonderful match that took a ridiculously long line of test and cut out what I wanted and put it into cells of an array. @ClickArray = $ClickPage ~~ m:g/ .*? | \h+ > /; I do not understand what he did. m:g = match and global <>= litteral ?

Re: Need regex ^? help

2024-05-06 Thread ToddAndMargo via perl6-users
This is what I have so far. my $x=" 1.2.3.4:12345 "; $x = $x.trim; $x~~s/(.*'.') .*/$0$(Q[0/24])/; say "<$x>"; <1.2.3.0/24> It works. Is there a way to petty it up with ^ and $ ?

Re: Need regex ^? help

2024-04-29 Thread ToddAndMargo via perl6-users
On 4/29/24 17:57, Patrick R. Michaud wrote: Perhaps not really what you're intending, but here's how I'd start: $ raku -e 'my $x="1.2.3.4"; $x ~~ s!\d+$!0/24!; say $x;' 1.2.3.0/24 The pattern part of the substitution matches all of the digits at the end of the string (\d+$), then rep

Re: Need regex ^? help

2024-04-29 Thread Patrick R. Michaud
Perhaps not really what you're intending, but here's how I'd start: $ raku -e 'my $x="1.2.3.4"; $x ~~ s!\d+$!0/24!; say $x;' 1.2.3.0/24 The pattern part of the substitution matches all of the digits at the end of the string (\d+$), then replaces them with the string "0/24". Everything p

Re: Need regex ^? help

2024-04-29 Thread ToddAndMargo via perl6-users
On 4/29/24 17:42, ToddAndMargo via perl6-users wrote: Hi All, I thought I understood ^ and ? used in a regex'es, but I don't. ^ means from the beginning and ? from the end. I am trying to put together an example of how to use them: I have    1.2.3.4 I want    1.2.3.0/24 So Far I have (no

Need regex ^? help

2024-04-29 Thread ToddAndMargo via perl6-users
Hi All, I thought I understood ^ and ? used in a regex'es, but I don't. ^ means from the beginning and ? from the end. I am trying to put together an example of how to use them: I have 1.2.3.4 I want 1.2.3.0/24 So Far I have (not working): raku -e 'my $x="1.2.3.4"; $x~~s/ (.*) $(Q

Re: need native call help

2024-04-19 Thread Todd Chester via perl6-users
On 4/18/24 04:50, yary wrote: I did a lot of very deep windows programming in my previous job and reminding me that I would always use the 8.3 short name for file operations! dir /x will get it for you. Must be API called for it also. Probably only works on local volumes not network rounded

Re: need native call help

2024-04-18 Thread yary
I did a lot of very deep windows programming in my previous job and reminding me that I would always use the 8.3 short name for file operations! dir /x will get it for you. Must be API called for it also. Probably only works on local volumes not network rounded ones. Just a guess. I've run into pr

Re: need native call help

2024-04-17 Thread ToddAndMargo via perl6-users
On 4/17/24 19:10, William Michels via perl6-users wrote: Hi Todd, Here are a few U&L StackExchange answers that I wrote using Raku's `unlink`: https://unix.stackexchange.com/questions/459521/how-to-truncate-file-to-maximum-number-of-characters-not-bytes/751267#751267 https://unix.stackexchange

Re: need native call help

2024-04-17 Thread William Michels via perl6-users
Hi Todd, Here are a few U&L StackExchange answers that I wrote using Raku's `unlink`: https://unix.stackexchange.com/questions/459521/how-to-truncate-file-to-maximum-number-of-characters-not-bytes/751267#751267 https://unix.stackexchange.com/questions/749558/remove-exact-line-from-file-if-prese

Re: need native call help

2024-04-17 Thread ToddAndMargo via perl6-users
On 4/17/24 05:52, yary wrote: From unlink's documentation: If the file to be deleted does not exist, the routine treats it as success. So trying to delete a file that isn't there, doesn't have an error, which is kind of neat, but that is a difference from native delete. -y Hi Yary, Not t

Re: need native call help

2024-04-17 Thread ToddAndMargo via perl6-users
On 4/17/24 05:52, yary wrote: From unlink's documentation: If the file to be deleted does not exist, the routine treats it as success. So trying to delete a file that isn't there, doesn't have an error, which is kind of neat, but that is a difference from native delete. -y Hi Yary, Not

Re: need native call help

2024-04-17 Thread ToddAndMargo via perl6-users
On 4/17/24 05:50, yary wrote: What does the windows native delete do which you need, that raku's unlink doesn't have? without unlink $FileName { say "Could not delete $FileName:", .exception.message }; -y Hi Yary, This is Windows we are dealing with. It is a kluge. I have had unlink fail

Re: need native call help

2024-04-17 Thread yary
>From unlink's documentation: If the file to be deleted does not exist, the routine treats it as success. So trying to delete a file that isn't there, doesn't have an error, which is kind of neat, but that is a difference from native delete. -y On Wed, Apr 17, 2024 at 8:50 AM yary wrote: >

Re: need native call help

2024-04-17 Thread yary
What does the windows native delete do which you need, that raku's unlink doesn't have? without unlink $FileName { say "Could not delete $FileName:", .exception.message }; -y On Wed, Apr 17, 2024 at 2:29 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 4/16/24 23:25, ToddAnd

Re: need native call help

2024-04-16 Thread ToddAndMargo via perl6-users
On 4/16/24 23:25, ToddAndMargo via perl6-users wrote: `\\>\` should have been `\\?\`

Re: need native call help

2024-04-16 Thread ToddAndMargo via perl6-users
On 4/16/24 20:57, ToddAndMargo via perl6-users wrote:    $LongName = $FileName;    if $FileName.chars >= MAX_PATH  { $LongName = Q[\\?\] ~ $FileName; } What the about is all about is that MAX_PATH, which limits the file name to 260 characters, can go up to 32,767 wide characters, prepend "\\

Re: need native call help

2024-04-16 Thread ToddAndMargo via perl6-users
On 4/16/24 18:43, ToddAndMargo via perl6-users wrote: On 4/16/24 01:21, ToddAndMargo via perl6-users wrote: Hi All, Windows 11 It has been so long that I have done one of these that my brain is seizing. https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea C++ B

Re: need native call help

2024-04-16 Thread ToddAndMargo via perl6-users
On 4/16/24 01:21, ToddAndMargo via perl6-users wrote: Hi All, Windows 11 It has been so long that I have done one of these that my brain is seizing. https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea C++ BOOL DeleteFileA(   [in] LPCSTR lpFileName ); Would s

need native call help

2024-04-16 Thread ToddAndMargo via perl6-users
Hi All, Windows 11 It has been so long that I have done one of these that my brain is seizing. https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea C++ BOOL DeleteFileA( [in] LPCSTR lpFileName ); Would some kind soul please show me how to do this again? Many

Re: I need sorting help

2024-03-16 Thread ToddAndMargo via perl6-users
On 3/2/24 05:13, Elizabeth Mattijsen wrote: $ raku -e '.say for .sort(*.split(/\d+/, :kv).map({ (try .Numeric) // $_}).List) afoo2 afoo12 On 2 Mar 2024, at 07:26, ToddAndMargo via perl6-users wrote: Hi All, @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self })}

Re: I need sorting help

2024-03-09 Thread Ralph Mellor
On Sat, Mar 9, 2024 at 7:52 PM yary wrote: > how to sort by alpha & numeric segments (b3b, a1a, c20c) => (a1a, b3b, c2c) Ahhh. D'oh. Thanks! 💚 Now I see what was required, or at least think I do: .sort: {m:g/ \d+{make +$/} | \D+{make ~$/} /».made} That does what was meant, right? -- love, r

Re: I need sorting help

2024-03-09 Thread yary
Using my quick-intuition, are these methods sorting on the earliest number withing the string, ignoring the non-digits? $ raku -e '.say for .sort: {m/ \d+ /.Int}' $ raku -e '.say for .sort: +*.match: / \d+ /' let's see $ raku -e '.say for .sort: {m/ \d+ /.Int}' it1 does2 not3 matter10 what20 the

Re: I need sorting help

2024-03-07 Thread Ralph Mellor
On Tue, Mar 5, 2024 at 7:01 AM ToddAndMargo via perl6-users wrote: > >> $ raku -e '.say for .sort(*.split(/\d+/, :kv).map({ > >> (try .Numeric) // $_}).List)' > >> > >> Yippee! > > raku -e '.say for .sort: { .comb(/ \d+ | \D+ /).map({ > > .Int // .self }).cache };' > > Awesome! Now I have two

Re: I need sorting help

2024-03-04 Thread ToddAndMargo via perl6-users
On 3/4/24 23:01, ToddAndMargo via perl6-users wrote: No I have Sould have been Now I have

Re: I need sorting help

2024-03-04 Thread ToddAndMargo via perl6-users
On 3/4/24 22:09, Bruce Gray wrote: On Mar 4, 2024, at 15:55, ToddAndMargo via perl6-users wrote: --snip-- $ raku -e '.say for .sort(*.split(/\d+/, :kv).map({ (try .Numeric) // $_}).List)' bk1 bk2 bk10 bk34 Yippee! tony@rn6:/home/linuxutil1$ raku -e '.say for .sort: { .comb(/ \d+ |

Re: I need sorting help

2024-03-04 Thread Bruce Gray
> On Mar 4, 2024, at 15:55, ToddAndMargo via perl6-users > wrote: --snip-- > $ raku -e '.say for .sort(*.split(/\d+/, :kv).map({ (try > .Numeric) // $_}).List)' > bk1 > bk2 > bk10 > bk34 > > Yippee! > > > tony@rn6:/home/linuxutil1$ raku -e '.say for .sort: { > .comb(/ \d+ | \D+ /) .map

Re: I need sorting help

2024-03-04 Thread ToddAndMargo via perl6-users
On 3/4/24 13:55, ToddAndMargo via perl6-users wrote: On 3/4/24 12:40, Ralph Mellor wrote: On Sat, Mar 2, 2024 at 6:26 AM ToddAndMargo via perl6-users wrote: @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self })}; In case another answer is helpful... First, a sim

Re: I need sorting help

2024-03-04 Thread ToddAndMargo via perl6-users
On 3/4/24 12:40, Ralph Mellor wrote: On Sat, Mar 2, 2024 at 6:26 AM ToddAndMargo via perl6-users wrote: @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self })}; In case another answer is helpful... First, a simplified sort that produces the same result as your cod

Re: I need sorting help

2024-03-04 Thread Ralph Mellor
> @Sorted_List .= sort: *.match: / \d+ /; > ... > @Sorted_List .= sort: +*.match: / \d+ /; Or perhaps easier to understand: @Sorted_List .= sort: {m/ \d+ /.Str} vs @Sorted_List .= sort: {m/ \d+ /.Int} love, raiph

Re: I need sorting help

2024-03-04 Thread Ralph Mellor
On Sat, Mar 2, 2024 at 6:26 AM ToddAndMargo via perl6-users wrote: > > @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self > })}; In case another answer is helpful... First, a simplified sort that produces the same result as your code above: @Sorted_List .= sort: *.ma

Re: I need sorting help

2024-03-02 Thread Clifton Wood
Easy multisort! my @h = ( { name => "albert", age => 40, size => 2 }, { }, { ); # ({age => 40, name => albert, size => 2} {age => 69, name => albert, size => 3} {age => 22, name => andy, size => 3}) On Sat, Mar 2, 2024 at 9:29 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote:

Re: I need sorting help

2024-03-02 Thread ToddAndMargo via perl6-users
On 3/2/24 05:13, Elizabeth Mattijsen wrote: .sort(*.split(/\d+/, :kv).map({ (try .Numeric) // $_}).List) Hi Elizabeth, It works perfectly. Thank you! I have no idea why, I will ask you in another post -T

RE: I need sorting help

2024-03-02 Thread Mark Devine
Elizabeth, I have been looking for that one to sort operating system devices. Exceptional timing! Thanks, Mark Devine (202) 878-1500 -Original Message- From: Elizabeth Mattijsen Sent: Saturday, March 2, 2024 8:14 AM To: ToddAndMargo via perl6-users Subject: Re: I need sorting help

Re: I need sorting help

2024-03-02 Thread Elizabeth Mattijsen
$ raku -e '.say for .sort(*.split(/\d+/, :kv).map({ (try .Numeric) // $_}).List) afoo2 afoo12 > On 2 Mar 2024, at 07:26, ToddAndMargo via perl6-users > wrote: > > Hi All, > > @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self > })}; > > gives me > > Element [0

I need sorting help

2024-03-01 Thread ToddAndMargo via perl6-users
Hi All, @Sorted_List = @Sorted_List.sort: { .comb(/ \d+ | \D+ /) .map({ .Int // .self })}; gives me Element [0] Element [1] Element [2] Element [3] Element [4] Element [5] Element [6] Element [7] Element [8] Element [9] I need it to say E

Re: Help with macports port for zef

2023-12-31 Thread raf via perl6-users
On Sun, Dec 31, 2023 at 07:09:07AM -0600, Tom Browder wrote: > On Mon, Nov 27, 2023 at 02:17 raf via perl6-users > wrote: > > > Hi. I'm trying to create a macports portfile for zef so > > > I'm not a Mac user, but I've been struggling with another Rakudo > installation method for Linux and

Re: Help with macports port for zef

2023-12-31 Thread William Michels via perl6-users
s://lists.macports.org/mailman/listinfo/macports-users > or, via email, send a message with subject or body 'help' to > macports-users-requ...@lists.macports.org > <mailto:macports-users-requ...@lists.macports.org> > > You can reach the person managing the list

Re: Help with macports port for zef

2023-12-31 Thread Tom Browder
On Mon, Nov 27, 2023 at 02:17 raf via perl6-users wrote: > Hi. I'm trying to create a macports portfile for zef so I'm not a Mac user, but I've been struggling with another Rakudo installation method for Linux and had similar problems. My solution has been to install the binary code for linux

Help with macports port for zef

2023-11-27 Thread raf via perl6-users
Hi. I'm trying to create a macports portfile for zef so that macports users can easily install zef using macports. Currently, the only raku-related port on macports is rakudo itself (and nqp). A zef port would be a great next step. But I'm not a raku expert or a macports expert, so I nee

Re: Need regex in the middle wildcard help

2023-06-19 Thread ToddAndMargo via perl6-users
= $0 ~ $1 ~ " " ~ $2; print "$y\n\n"; $ RegexTest.pl6 0 = 1 = <-8.6-1.fc38.i686.rpm> 2 = wine-8.6-1.fc38.i686.rpm wine-8.6-1.fc38.x86_64.rpm After Joseph's help:   $SysRev  = $WebPage;   $SysRev~~m:i/  .*? ("wine")  (.*?)  $(Q[">] )  .

Re: Need regex in the middle wildcard help

2023-06-19 Thread Richard Hainsworth
$y\n\n"; $ RegexTest.pl6 0 = 1 = <-8.6-1.fc38.i686.rpm> 2 = wine-8.6-1.fc38.i686.rpm wine-8.6-1.fc38.x86_64.rpm After Joseph's help:   $SysRev  = $WebPage;   $SysRev~~m:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a href="]

Re: Need regex in the middle wildcard help

2023-06-19 Thread ToddAndMargo via perl6-users
   Q[href="wine-alsa-8.6-1.fc38.i686.rpm">wine-alsa-8.6-1.fc38.i686.rpm  19-Apr-2023 21:48  223K]; $x~~m:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a href="] )  (.*?) ( $(Q[">] ) )  /; print "0 = <$0>\n1 = <$1>\n2 = <$2>\n

Re: Need regex in the middle wildcard help

2023-06-19 Thread ToddAndMargo via perl6-users
On 6/18/23 05:38, ToddAndMargo via perl6-users wrote: Hi All, I know how to do this with several regex's and words. What I'd like to learn is how to remove something from the middle with regex using a wild card. And I can't figure it out #!/bin/raku print "\n"; my Str $x = Q[wine-7.12-3.fc37

Subject: Re: Need regex in the middle wildcard help

2023-06-18 Thread Joseph Brenner
References: Try something like this, perhaps: $x ~~ s:i/ ^ (.*?) '' .*? '

Need regex in the middle wildcard help

2023-06-18 Thread ToddAndMargo via perl6-users
Hi All, I know how to do this with several regex's and words. What I'd like to learn is how to remove something from the middle with regex using a wild card. And I can't figure it out #!/bin/raku print "\n"; my Str $x = Q[wine-7.12-3.fc37.i686.rpm23-Jul-2022 19:11 11K print "1 [$x]\n\n

Re: Help with %?RESOURCES variable

2023-04-20 Thread Will Coleda
On Mon, Apr 17, 2023 at 12:01 David Santiago wrote: > > I'm trying to use the variable %?RESOURCES without success. It doesn't > work even when i install it locally with zef > > I have the following: > > demanuel@archlinux test> cat resources/text.txt > This is my test file > demanuel@archlinux t

Re: Help with %?RESOURCES variable

2023-04-20 Thread Marcel Timmerman
On 17-04-2023 18:01, David Santiago wrote: sub MAIN(){ say %?RESOURCES{"text.txt"}.slurp(:close); } If you really want to use it from a MAIN you could make a lookup method in a module which can do the work for you (If  you are building modules anyway). use AModule; sub MAIN(){ say AModule.

Re: Help with %?RESOURCES variable

2023-04-19 Thread Polgár Márton
I mean, yes... the program runs at runtime. Anything available to the program is "available during runtime". Yes, you can look up the content at runtime - e.g from the place where it's installed. It is NOT advised to try and change the content that you can look up with %?RESOURCES - you aren't

Re: Help with %?RESOURCES variable

2023-04-19 Thread yary
https://docs.raku.org/language/variables says > %?RESOURCES is a compile-time variable available to the code of a > Distribution . > > It contains a hash that provides compile and runtime access to files > associated with the Distribution of the curren

Re: Help with %?RESOURCES variable

2023-04-19 Thread Brad Gilbert
Unless things have changed since I was last active, only modules are precompiled. `?` Twigilled variables are set at compile time. So if it had any values, they wouldn't be useful, because they would be created anew every time. On Mon, Apr 17, 2023, 11:48 AM David Santiago wrote: > > Hi Polgár >

Re: Help with %?RESOURCES variable

2023-04-17 Thread David Santiago
Hi Polgár A seg, 17-04-2023 às 18:08 +0200, Polgár Márton escreveu: > I think this is the classic case of ?-twigilled, "compile-time" > variables only being available in modules. It kind of forces you to > always have the pattern of: heavy-lifting in a module inside lib, and > the script just

Re: Help with %?RESOURCES variable

2023-04-17 Thread Polgár Márton
I think this is the classic case of ?-twigilled, "compile-time" variables only being available in modules. It kind of forces you to always have the pattern of: heavy-lifting in a module inside lib, and the script just uses the module. On 2023. 04. 17. 18:01, David Santiago wrote: I'm trying t

Re: Help with %?RESOURCES variable

2023-04-17 Thread JJ Merelo
Can you maybe list %?RESOURCES? I see nothing wrong with it, but just in case. El lun, 17 abr 2023 a las 18:01, David Santiago () escribió: > > I'm trying to use the variable %?RESOURCES without success. It doesn't > work even when i install it locally with zef > > I have the following: > > deman

Help with %?RESOURCES variable

2023-04-17 Thread David Santiago
I'm trying to use the variable %?RESOURCES without success. It doesn't work even when i install it locally with zef I have the following: demanuel@archlinux test> cat resources/text.txt This is my test file demanuel@archlinux test> cat bin/run-me sub MAIN(){ say %?RESOURCES{"text.txt"}.slu

Help: will you be a friend and advocate. Did I put myself under hypnosis? Scripts.

2022-08-30 Thread Maneesh D. Sud
Will larry wall himself respond: help. I read parts of Programming Perl. Respect for artificial languages and the mathematicians that implement. I need friends that are smart, understand computer engineering and the dangers of playing Dungeons' and Dragons. I am intelligent and defi

Reno 911 || AIDS not HIV. TV/TB. Please help I need a healer.

2022-08-29 Thread Maneesh D. Sud
Well, my habit of asking "url?" had not changed a bit; descriptions of objects cannot be resolved into real ideas without a pointer, and URL is a very good and precise way to motivate people putting their ideas into resolvable entities. I may not have internet access when I need a lifesaver. I n

Re: Help with promises, supplies and channels.

2022-04-08 Thread William Michels via perl6-users
Wow that was fast! Thanks Liz! On Thu, Apr 7, 2022 at 3:25 AM Elizabeth Mattijsen wrote: > Fixed with > https://github.com/rakudo/rakudo/commit/5658f4da07b44d492a3d35d57fa76939822d2c66 > > Thanks for the report! > > > On 7 Apr 2022, at 11:28, David Emanuel da Costa Santiago < > deman...@gmail.c

Re: Help with promises, supplies and channels.

2022-04-07 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/5658f4da07b44d492a3d35d57fa76939822d2c66 Thanks for the report! > On 7 Apr 2022, at 11:28, David Emanuel da Costa Santiago > wrote: > > > Thanks for the information! > > I opened a bug in rakudo: > > https://github.com/rakudo/rakudo/issues

Re: Help with promises, supplies and channels.

2022-04-07 Thread David Emanuel da Costa Santiago
Thanks for the information! I opened a bug in rakudo: https://github.com/rakudo/rakudo/issues/4853 Regards, David Santiago Às 05:27 de 07/04/22, yary escreveu: For what it's worth, I'm on a mac, promise_test.raku hangs for me once in a while also. Welcome to Rakudo(tm) v2021.04. Impleme

Re: Help with promises, supplies and channels.

2022-04-06 Thread yary
For what it's worth, I'm on a mac, promise_test.raku hangs for me once in a while also. Welcome to Rakudo(tm) v2021.04. Implementing the Raku(tm) programming language v6.d. Built on MoarVM version 2021.04. Trying to reduce it, I would like to find a program that reliably tickles this bug and hang

Re: Help with promises, supplies and channels.

2022-04-05 Thread William Michels via perl6-users
Thanks for the bash loop. I'm seeing a few hangs, also some errors returned saying: "Unhandled exception in code scheduled on thread 4" (MacOS 11.11) On Tue, Apr 5, 2022 at 12:47 PM David Emanuel da Costa Santiago < deman...@gmail.com> wrote: > > Hi William, > > when it fails or hangs it doesn'

Re: Help with promises, supplies and channels.

2022-04-05 Thread David Emanuel da Costa Santiago
Hi William, when it fails or hangs it doesn't print the last line. Please check attached file for output of the stack. Since the failures are random, it's easier to invoke it in a loop: bash$ for i in $(seq 100); do raku test.raku; done If nothing is wrong with the code, i'll open a bug in t

Re: Help with promises, supplies and channels.

2022-04-05 Thread William Michels via perl6-users
No problems so far. say $*VM; #add as last line, returns: moar (2021.06) On Tue, Apr 5, 2022 at 11:06 AM David Emanuel da Costa Santiago < deman...@gmail.com> wrote: > Hi, > > > > I'm trying to learn about promises, supplies and channels. So i made > this code: > > """ > > my $p1 = Supply.interv

Help with promises, supplies and channels.

2022-04-05 Thread David Emanuel da Costa Santiago
Hi, I'm trying to learn about promises, supplies and channels. So i made this code: """ my $p1 = Supply.interval(5); my $p2 = Supply.interval(2); my Channel $ch = Channel.new; my $prom = start react { whenever $p1 -> $interval { say "5"; } whenever $p2 -> $interval {

Re: Grammar Help

2021-12-29 Thread Ralph Mellor
On Wed, Dec 29, 2021 at 5:10 PM Paul Procacci wrote: > > Ralph, > > So Ijust tried comma w/ grammar live view ... and I must say, > I'm blown away. \o/ > This really should be in the docs (it may be, but I didn't go looking for it). I just looked using googles such as: https://www.google.com/s

Re: Grammar Help

2021-12-29 Thread Paul Procacci
Ralph, So Ijust tried comma w/ grammar live view because as I expand the logic to encompass other things it became further and further unwieldy ... and I must say, I'm blown away. This really should be in the docs (it may be, but I didn't go looking for it). It's really awesome to say the least

Re: Grammar Help

2021-12-29 Thread Brian Duggan
On Sunday, December 26, Paul Procacci wrote: > > use Grammar::Tracer; > > and > > use Grammar::Tracer::Compact; > > Both I've found helpful, though obviously not fool proof. It'd be nice if > it show'd why it failed (i.e. what it encountered vs what it expected ) > rather than just a 'failed'

Re: Grammar Help

2021-12-26 Thread Paul Procacci
Hey all, Firstly, I want to thank everyone for all their responses. It helped greatly. I wanted to share what I ended up with that seems to be working. (below) I'm open to suggestions on how to improve this, tidy things up a bit, etc. Running on the below grammar yields the following what to me

Re: Grammar Help

2021-12-26 Thread Paul Procacci
Hey Ralph, I don't use Comma. I'm not a fan of IDE's and generally stick to vi for all my needs. Old habits are hard to break especially once you've been using the same tool for ~25 years like I have. ;( I've been switching back and forth between: use Grammar::Tracer; and use Grammar::Tracer

Re: Grammar Help

2021-12-26 Thread Ralph Mellor
On Sun, Dec 26, 2021 at 6:01 AM Paul Procacci wrote: > > Hope everyone had a Merry Christmas and takes likings to corny opening > statements. ;) I love me some corn but it's especially appropriate to share some in winter if you've got hungry mice. :) As others have noted, you need `%%` instead

Re: Grammar Help

2021-12-26 Thread William Michels via perl6-users
Hi Paul, Quick check yesterday you have a stray "l" character between two code blocks: method objectKey($/) { make $.made; }l # <-- WHAT'S THIS? method pairlist($/) { make $>>.made.flat; } I defer to Brad and Simon, otherwise. Best, Bill.

Re: Grammar Help

2021-12-26 Thread Brad Gilbert
I'm on mobile, but without checking, I think the problem is here rule pairlist { * % \; } Specifically it's the missing % rule pairlist { * %% \; } JSON doesn't allow trailing commas or semicolons, so JSON::Tiny uses just %. Your data does have trailing semicolons, so you want t

Re: Grammar Help

2021-12-26 Thread Simon Proctor
Still waking up but I think the issue is your pairlist has a semi colon divider but this should be after each pair. So the trailing semi colon after b is causing it to fail. On Sun, 26 Dec 2021, 06:01 Paul Procacci, wrote: > Hey all, > > Twas the night of Christmas, when all through the house,

Grammar Help

2021-12-25 Thread Paul Procacci
Hey all, Twas the night of Christmas, when all through the house, not a creature was stirring except Paul w/ his mouse. Hope everyone had a Merry Christmas and takes likings to corny opening statements. ;) I was writing a little something tonight using Grammars and ran into something that I can

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.

  1   2   3   4   5   6   7   8   9   10   >