This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:06
Heptite left
01:28
jgaz left
01:33
guifa left
|
|||
stevied | App::Mi6 is the best. I start modules with that and then import those new modules create with mi6 into comma | 01:57 | |
yeah, i'm still writing regexes with no spaces. old habits die hard | 01:59 | ||
ok, so how does zef determine what the newest version of a module is? It can't go by the version in meta6.json because those can be arbitrary and may not sort. REA has a "release-date" property but there is no time stamp for the date. | 02:01 | ||
02:32
Heptite joined
02:47
deadmarshal_ left
|
|||
here it is, the oldest living Raku disro: github.com/masak/crypt | 02:49 | ||
03:09
deadmarshal_ joined
|
|||
actually, this is the oldest one: github.com/cosimo/perl6-cache-memcached | 03:18 | ||
03:26
rf left
|
|||
jaguart | looking for a recommends on approach - I have 10 regex substitutions to apply to 10 strings - is this just going to be loops or is there some magic? | 03:30 | |
stevied | i would just do 10 loops but i'm not really the guy to ask | 03:32 | |
05:44
Heptite left
|
|||
Nahita | ``` | 07:48 | |
>>> @strs | |||
[wow yes real] | |||
>>> @trs | |||
[/o/ => e /s$/ => d /^r/ => $r] | |||
>>> @strs.&zip(@trs).flat.map({ $^s.subst(|$^t.kv) }) | |||
(wew yed $real) | |||
```not magic from me either | |||
09:01
jaguart left
|
|||
tbrowder | you might also look at Mi6::Helper | 10:38 | |
12:12
Kaipei joined
12:16
Kaiepi left
12:36
Heptite joined
13:11
NemokoschKiwi joined
14:30
jgaz joined
14:36
rf joined
14:42
NemokoschKiwi left
16:21
ab5tract joined
16:38
ab5tract left
17:05
ab5tract joined
17:19
ab5tract left
|
|||
rf | How can I label and extract something from a string with Regex (I think it's called capturing), basically I want something like "Hello Bob" ~~ /"Hello "$<name>/ -> name => 'bob' | 17:36 | |
m: "Hello Bob" ~~ /"Hello "$<name>/; | 17:38 | ||
camelia | ( no output ) | ||
17:38
NemokoschKiwi joined
|
|||
NemokoschKiwi | m: say "Hello Bob" ~~ /"Hello "$<name>/; | 17:39 | |
camelia | Nil | ||
NemokoschKiwi | well okay, it didn't match | 17:40 | |
you need to describe the pattern in-place, or define it in a standalone regex/token | |||
say "Hello Bob" ~~ /"Hello "$<name>=\w+/; #do I have the syntax right? | 17:41 | ||
m: say "Hello Bob" ~~ /"Hello "$<name>=\w+/; #do I have the syntax right? | |||
camelia | ļ½¢Hello Bobļ½£ name => ļ½¢Bobļ½£ |
||
NemokoschKiwi | seems so | ||
rf | Ah that makes sense | 17:59 | |
I'm having some troubles running a shell command from Raku, it looks like it's running but it doesn't do anything. "openssl req -new -x509 -newkey ec -subj \"CN=$domain\" -pkeyopt ec_paramgen_curve:prime256v1 -days 1825 -nodes -out cert.pem -keyout key.pem" is the command | 18:54 | ||
It returns a status code of 0 as well, which is really puzzling me | |||
NemokoschKiwi | how do you run it, what do you expect and what do you get? | 18:55 | |
rf | shell("openssl req -new -x509 -newkey ec -subj \"CN=$domain\" -pkeyopt ec_paramgen_curve:prime256v1 -days 1825 -nodes -out cert.pem -keyout key.pem"), I expect the cert to be made, but it isn't. I get a response object that has a status code of 0 | 18:56 | |
I don't care about stdout or stderr etc related to the process | |||
NemokoschKiwi | So should this generate a file? | 18:57 | |
rf | 2 files | ||
cert.pem and key.pem | |||
in cwd | |||
I think I got it, I was missing a / before CN=... | 19:03 | ||
NemokoschKiwi | it makes you wonder how the code could be 0 | ||
rf | Still doesn't work :D | ||
NemokoschKiwi | for me it did generate an error for the wrong format, at least | 19:05 | |
rf | Okay, I finally got it. /CN=\"$domain\" too many dang slashes | ||
NemokoschKiwi | for me it worked with \"/CN=$domain\" | 19:07 | |
but yeah it might be a better idea to escape the variable | |||
also, don't forget that you could use doublequotes with e.g qq[...] as well | 19:08 | ||
sometimes I find that clearer when some nesting is going on | |||
rf | Yeah I'll switch it over to that, thanks | ||
NemokoschKiwi | or downright use qqx[...] instead of shell("...") :P | 19:11 | |
(that pipes the stdout into the return value, by the way) | 19:12 | ||
19:19
jgaz left
19:24
rf left
19:32
rf joined
19:59
ab5tract joined
20:31
ab5tract left
20:37
ab5tract joined
20:47
ab5tract left
22:01
jgaz joined
22:06
destroycomputers joined
23:09
ab5tract joined
23:19
jgaz left
23:54
kjp left
23:57
kjp joined
23:59
jaguart joined
|