Re: I need one liner module import help

2019-06-11 Thread Bruce Gray
ust missing the correct syntax, or if there is a bug in Rakudo. Either way, there are docs and tests that need to be added. EOUTOFTIME, this email stands alone, no bugs filed. — Bruce Gray (Util of PerlMonks)

Re: I need one liner module import help

2019-06-12 Thread Bruce Gray
roduced a point of confusion. In Perl 5 and Perl 6, double-colons are a namespace separator. The module Audio::Taglib::Simple is a single module, but can be thought of as "the Simple module, of possibly-a-bunch-of Taglib modules, of the overall family of Audio modules". In the same way

Re: [golf?] list of matches

2019-07-09 Thread Bruce Gray
6.org/routine/combinations # -- # Hope this helps, # Bruce Gray (Util of PerlMonks)

Re: [golf?] list of matches

2019-07-10 Thread Bruce Gray
).map: -> \p2 { p1, p2 } } I mention it because I had not though to use .skip for this purpose until today. > thank you very much. You are very welcome. — Bruce Gray (Util of PerlMonks)

Re: while(<>){...} analog?

2019-07-28 Thread Bruce Gray
LES, which defaults to $*IN in the absence of any filenames. For example: perl6 -e 'say .join("\t") for lines().rotor(4);' path/to/file.txt Hmmm. I would expect that to be in the Perl 5 to Perl 6 Migration Guides, but I do not see it there. — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: while(<>){...} analog?

2019-08-01 Thread Bruce Gray
d gobbling block and when it tries to parse the block for the if-statement, it doesn't find one: Missing block (apparently claimed by 'random-choice') — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: flat a lazy gather ?

2019-08-09 Thread Bruce Gray
do not treat `.flat` the same way. E.g.: $ perl6 -e 'say (, ).flat.elems' 3 $ perl6 -e 'say [, ].flat.elems' 2 Full answer coming when time allows. For such a small fix, it was surprisingly effortful to figure out. See https://docs.perl6.org/language/list#Itemization — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: split to walk into an HoH ?

2019-11-22 Thread Bruce Gray
sted above, I get this output: A 2 3 B 2 3 The first key of each second level is missing, which differs from your sample output above. Have I corrupted your Awk code, or have I misunderstood something, or what? -- Thank you, Bruce Gray (Util of PerlMonks)

Re: split to walk into an HoH ?

2019-11-22 Thread Bruce Gray
> On Nov 22, 2019, at 9:57 AM, Marc Chantreux wrote: > > On Fri, Nov 22, 2019 at 06:20:51AM -0800, William Michels via perl6-users > wrote: >> Hi Marc, I did a search for 'semicolon' on the following page and >> found the interesting text below. Semicolons are used to create >> multidimension

Re: bash "."?

2020-05-13 Thread Bruce Gray
config.json { "baz": "quxx", "foo": "bar” } $ perl6 -e 'use Config::JSON; my %c; %c{$_} = jconf($_) for ; say %c{$_} for ;' bar quxx $ cat b.dat foo = bar baz = quxx $ perl6 -e 'use Config::Tiny:from; my $conf = Config::Tiny.read("b.dat"); .say for $conf<_>' bar quxx — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: sqrt and Buf question

2020-05-14 Thread Bruce Gray
oint of the result. Exact code here: https://rosettacode.org/wiki/Integer_roots#Raku — Hope this helps, Bruce Gray (“Util” on RosettaCode, too)

Re: sqrt and Buf question

2020-05-15 Thread Bruce Gray
> On May 14, 2020, at 4:36 PM, ToddAndMargo via perl6-users > wrote: > > On 2020-05-14 08:13, Bruce Gray wrote: >>> On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> 1) how do I g

Re: Help converting CArray[uint8] to Blob

2020-06-16 Thread Bruce Gray
#x27;; time_it(2); Output: Bindata in 8.207297 Bindata in 8.12964 Bindata in 8.0798136 Bindata in 3.434386 Bindata in 3.4062148 Bindata in 3.35743893 — Hope this helps, Bruce Gray (Util of PerlMonks) > On Jun 16, 2020, at 5:17 PM, David Santiago wrote: >

Re: doing an inner join via cross-product

2020-07-20 Thread Bruce Gray
l.so; printf "%12s: level: %-2d origin: %3s\n", .key, .value for %inner_joined_monsters.sort; Produces: godzilla => ${:level(9), :origin("jp")} gremlin => ${:level(3), :origin(Any)} hanuman => ${:level(5), :origin("il")} tingler => ${:level(Any), :origin("us")} godzilla: level: 9 origin: jp hanuman: level: 5 origin: il — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: print particular lines question

2020-08-25 Thread Bruce Gray
pre-increment allows you to specify the line numbers with the more natural numbering: raku -ne '.say if ++$ == any(1,3,7);' Lines.txt Line 1 Line 3 Line 7 -- Bruce Gray (Util of PerlMonks)

Re: Any other way to do this

2020-08-31 Thread Bruce Gray
my $is_a_number = / ^ \d+ [ '.' \d* ]? $ /; my $sum = @*ARGS.grep($is_a_number).sum; say $sum; — Hope this helps, Bruce Gray (Util of PerlMonks) > On Aug 31, 2020, at 12:22 PM, William Michels via perl6-users > wrote: > > I think it looks very good, Radhakrishnan! Pr

Re: Any other way to do this

2020-08-31 Thread Bruce Gray
-line arguments, but only those arguments that are valid numbers — Hope this helps, Bruce Gray (Util of PerlMonks) > On Aug 31, 2020, at 2:23 PM, dan...@codesections.com wrote: > > I like Bruce's Regex-based approach. > > Here's how I'd probably approach

Re: Any other way to do this

2020-08-31 Thread Bruce Gray
readers who have not yet embraced the map/grep mindset we have been showing off. my @nums; for @*ARGS -> $arg { push @nums, $arg if $arg.Rat; } say @nums.sum; -- Hope this helps, Bruce Gray (Util of PerlMonks) > On Aug 31, 2020, at 3:02 PM, William Michels wrote: > > Very

Re: cross reduce operator magic

2020-10-11 Thread Bruce Gray
g/language/operators#index-entry-X_(cross_metaoperator) https://docs.raku.org/language/operators#index-entry-cross_product_operator If any part of this was lacking in clarity, please let me know where to focus, and I will be glad to expound. -- Hope this helps, Bruce Gray (Util of Perlmonks)

Re: New Raku 2020.10.02

2020-10-29 Thread Bruce Gray
; (since I do not use those packages myself); I am just trying to answer the implied question. -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Bruce Gray
hoice of symbols and order is only obvious (to we hexidecimal-trained humans) up to (Arabic numbers + English Alphabet). -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Bruce Gray
` is no longer needed. subset test-set of Str where *.&is-valid; sub real-use-of-subsets ( test-set $var1 ) { say "This is definitely a `test-set`: $var1"; } sub real-use-of-subsets ( test-set $var1 ) { say "Not a `test-set`: $var1"; } # Test it. real-use-of-subsets('abc'); real-use-of-subsets('^’); — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: \n and array question

2020-11-14 Thread Bruce Gray
2 () 5 6 (1 2 1) (1 1) Str @z = "\n" Str @z = "\\n" Str @z = "\\n" List @z = $( ) Str @z = "a \n b" Str @z = "a \\n b" List @z = $("a", "\\n", "b") List @z = $("a", "b") — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: I need help setting up a method

2020-12-19 Thread Bruce Gray
4..4)).pick For more detail on Raku Randomess, you might enjoy the first third of my 2018 talk: https://www.youtube.com/watch?v=DJCp6k1ts3g Perl 6 and the Emergent Program.* 3m22s - 13m33s -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: I need help with cosine and ()

2020-12-20 Thread Bruce Gray
ant: say cos 45*π/180; but also would be clearer with parens: say cos( 45*π/180 ); For the whole precedence table, see: https://docs.raku.org/language/operators#Operator_precedence -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Is the cosine page wrong?

2020-12-20 Thread Bruce Gray
me of your choice , if that makes more sense in your code. my Str $a = ’15'; my Str $b = '37'; say $b.cos; Inside method `cos`, during the .cos call in the code above, “self” is an alias to $b . — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: list assignment

2021-01-19 Thread Bruce Gray
ontextualizer So, I recommend .list or @(…) as more intuitive, maybe even *sufficiently* intuitive :^) > thanks > Brian — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: gather take eager syntax

2021-04-20 Thread Bruce Gray
eager "foo"=>1 }; say .raku ~ ' is a ' > ~ .WHAT.gist for @a; $(:foo(1),) is a (List) This does not address why `eager` is changing the pair constructor, but it simplifies future discussion, and also shows that while only #4 of the OP REPL samples was throwing the error, #3 is actually also not producing what was desired. -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: how to form rules for commutative triads?

2021-05-29 Thread Bruce Gray
_expression…by me”, it sounds like you can’t/won't pursue this shortened form of the regex because you don’t actually *know* the long form of the regex yet. If so, since #1 is not available, I would do #4 until the full details of all the operands becomes clear, then try to refactor to #2 or #3. > rir -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: What's going on with "given (junction) {when (value)...}"

2021-05-31 Thread Bruce Gray
2020.07True 2020.07.16.g.03.d.3.e.43.faTrue 2020.08True 2020.08True 2020.09True 2020.12False 2020.11True 2020.12False 2021.02False 2021.02False 2021.03False 2021.04False 2021.05False 2021.05False 2021.05False In https://github.com/MoarVM/MoarVM/blob/master/docs/ChangeLog , I see nothing in 2020.11 that looks like the culprit. In https://github.com/rakudo/rakudo/blob/master/docs/ChangeLog , I see nothing in 2020.11 that looks like the culprit, but that big change in coersion ("new coertion semantics”) was big enough to make that a good candidate for proper bisecting. (but not by me; I am out of time for this week) — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How do a pe-salt an array inside an object?

2021-07-06 Thread Bruce Gray
my $CC = AA.new( I => @will_become_I_soon ); or my $CC = AA.new( I => [ flat( Str xx 400, "four hundred", Str xx 2000-400-1, "two thousand" ) ] ); -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: use lib and locations in a variable

2021-07-11 Thread Bruce Gray
> On Jul 11, 2021, at 1:13 AM, ToddAndMargo via perl6-users > wrote: —snip-- > $*PROGRAM.parent is just a silly dot. —snip— Todd, That is true only when the program you are running happens to be in your current directory (as is very common, but not nearly universal, and not the case for

Re: XML module question?

2021-07-16 Thread Bruce Gray
= do for lines() > {(.words[3..*],.words[0..2])}; .put for @reordered;’ lat_lon.txt I am sure that `-MXML` is leftover from other experiments. Removing `@reordered` and switching to `-n` like my critiques above, this becomes: raku -ne 'put (.words[3..*],.words[0..2]);' lat_lon.txt To “wow” the SO crowd, you might note that @array[N..*],@array[0..N-1] has a shortcut in Raku (.rotate), making this the tightest of all the solutions I see so far: raku -ne 'put .words.rotate(3);' lat_lon.txt -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: XML module question?

2021-07-16 Thread Bruce Gray
5PM 11-06-2014 - 10:51:21PM 11-06-2014 - 10:52:08PM 11-06-2014 - 10:53:30PM 11-06-2014 - 10:54:50PM I do note that XML::Writer does not show up in the search at https://modules.raku.org/t/XML , and is very under-documented, so that is an opportunity for someone to contribute. -- Hope this helps,

Re: I need a better regex with a literal in it

2021-10-23 Thread Bruce Gray
567890123456' x 100); # Uncomment one of these two lines: $NewRev ~~ s/ .*? ('Release Notes V') //; # Original # $NewRev ~~ s/ ^ .*? ('Release Notes V') //; # Anchored -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: I need a better regex with a literal in it

2021-10-23 Thread Bruce Gray
> On Oct 23, 2021, at 7:48 PM, ToddAndMargo via perl6-users > wrote: > > On 10/23/21 17:37, Bruce Gray wrote: >>> On Oct 23, 2021, at 6:43 PM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> Wish I had a

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Bruce Gray
part, with something like this (only lightly tested) code: @y .= head($wanted_decimal_places + $original_number.sqrt.floor.chars); -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: tons of digits

2022-06-10 Thread Bruce Gray
27453459686201472851741864088919860955232923048430871432145083976260362799525140798968725339654633180882964062061525835239505474575028775996172983557522033753185701135437460340849884709 -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: BigRoot precision question

2022-06-11 Thread Bruce Gray
( :$hexadecimal_precision_wanted, :$decimal_precision_via_log, :$decimal_precision_via_chars ); Output: hexadecimal_precision_wanted => 8192 decimal_precision_via_log => 9865 decimal_precision_via_chars => 9865 -- Hope this helps, Bruce Gray (Util of PerlMonks) [who just learned of the BigRoot module]

Re: trouble returning a value from sub

2022-06-18 Thread Bruce Gray
AIN gets 'a.txt' in $file1 and 'b.txt' in $file2. If I call it badly: ./myscript.raku a.txt b.txt c.txt , then I get an error, with a usage message auto-generated by Raku: myscript.raku [--dry-run] For full details, see: https://docs.raku.org/language/create-cli#index-entry-MAIN -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: append to Bug question

2022-06-18 Thread Bruce Gray
;Str'. The 'decode' method should > be used to convert a Buf to a Str. > [10] > $y += 0xBB; > Type check failed in assignment to $y; expected Buf but got Int (201) --snip-- If all you want is to append 0xBB to $y, either of these will work: $y ~= Buf.new(0xBB); $y.append(0xBB); -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: rotor in comb?

2022-08-27 Thread Bruce Gray
b} <=> $digraph{$a} || $a cmp $b } keys %digraph } $_=lc; while (/([a-z]{2})/g) {++$digraph{$1}; --pos; } ' Camelia.svg , when run against a downloaded copy of our mascot: https://upload.wikimedia.org/wikipedia/commons/8/85/Camelia.svg -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: BEGIN {} question

2022-08-28 Thread Bruce Gray
utside the BEGIN block"; # say "b_var is still $b_var outside the BEGIN block"; # Commented out, because illegal! Output: a_var is 42 within the BEGIN block b_var is 11 within the BEGIN block did something! By the way: a_var => 42 inside a sub called from the BEGIN block, because

Re: steps of a path

2022-09-03 Thread Bruce Gray
var/log/messages | raku -ne '.say for [\~] .comb: /\/<-[/]>+/;' /var /var/log /var/log/messages -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: steps of a path

2022-09-05 Thread Bruce Gray
rent ~~ "/") }' --snip-- The use of `.parent` inspired me to think of this shorter solution, via the Sequence Operator: $ raku -e '.put for "/var/log/messages".IO, *.parent …^ "/";' /var/log/messages /var/log /var https://docs.raku.org/language/operators#infix_... -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Bruce Gray
cd ~/Junk raku -e 'use lib "~/FakeDir"; use FakeModule;' ===SORRY!=== Error while compiling -e Could not find FakeModule in: file#/Users/bruce_pro/Junk/~/FakeDir ... -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
say for lines().tail(3)' a.1 98 99 100 real0m2.155s user0m1.727s sys 0m0.249s On Unix or Mac systems (and maybe Windows, UnxUtils or CygWin or GnuWin32 or Microsoft's own "Windows Subsystem for Linux"), faster (and prettier) to pipe to `tail -3`. $ tail -3 a.1 (and I presume) C:\> dir /s /A:-D /d /a | tail -3 -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
> On Oct 22, 2022, at 11:46 PM, ToddAndMargo via perl6-users > wrote: > > On 10/22/22 21:11, Bruce Gray wrote: >>> On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> Is there a

Re: folder size

2022-10-22 Thread Bruce Gray
t;.>)».s.sum;" -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: What does this line mean?

2022-11-25 Thread Bruce Gray
arameter list defines a default value. `$type` gets assigned the undefined-but-still-useful type-object of `Buf` only if no `type` argument is passed. So, a real-life call might look like: my $q = blob-from-pointer( $p, elems => 10, type => Blob[uint8] ); > :'( > > Yours in confusion, > -T -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Upcoming documentation meetings

2023-02-01 Thread Bruce Gray
f your phone company considers them free. In other words, you might get charged, but it is the phone company's charge, not Jitsi's. -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Is this a regex bug?

2023-06-20 Thread Bruce Gray
se HTML with regex; use a HTML parser". (We all parse HTML with regex anyway, on occasion; regex are just so easy to reach for.) To encourge you to consider the "correct" approach, I have appended a solution in just 6 SLOC. -- Hope this helps, Bruce Gray (Util of P

Re: keep getting this error emailed to me on fez upload of module: Error reading META from your last upload

2023-12-07 Thread Bruce Gray
github.com/tony-o/raku-fez/issues/105 -- Hope this helps, Bruce Gray (Util of PerlMonks) > On Dec 8, 2023, at 00:00, Francis Grizzly Smit wrote: > > Ooops sorry my bad > > On 8/12/23 16:55, Francis Grizzly Smit wrote: >> Hi >> >> keep getting this error email

Re: Your idea on how to detect random directory names

2023-12-08 Thread Bruce Gray
nderscores. > > Your take? --snip-- # Brave Browser temp directories: exactly 32 contiguous lowercase alpha characters. my $brave_junk_directories_re = / ^ <[a..z]> ** 32 $ /; my %to_skip = @filenames.grep($brave_junk_directories_re).Set; -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: -c question

2024-02-06 Thread Bruce Gray
ile check my modules if I > import them to a program and -c the program. > > For example, the following program uses > the above module: >$ raku -c CobianWrapper.pl6 >Syntax OK > > I just want to do a syntax check on my modules > at time without the program. > > :'( The wrapper program can be a `-e` one-liner, like: raku -c -e 'use NativeCall;' Syntax OK Does this work for you? raku -c -e 'use WinMessageBox;' -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: who call raku?

2024-02-08 Thread Bruce Gray
> On Feb 8, 2024, at 15:12, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Is there one of those fancy system variables that will > tell me who called/started raku? raku -e 'say $*USER' bruce -- Hope this helps, Bruce Gray (Util of Perlmonks)

Re: I need sorting help

2024-03-04 Thread Bruce Gray
reads that `.sort` needs would not play well with Seq. It does not matter whether you convert the numbers to a Numeric type (which you did correctly in the `.map`), they are still part of a Seq. The .cache method turns the Seq into a List, and the sort behaves as you intended. https://docs.raku.org/routine/cache -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: MAIN(*magic)

2024-03-15 Thread Bruce Gray
has $.expire; has $.interval; } my class Output { has $.csv; has $.html; has $.xml; has $.logger; } # XXX This would import the `auto-cli` function. # use Getopt::Attributes; # These must run before MAIN. my $t = auto-cli( Timer ); my $o = auto-cli( Output, :logger('localhost') ); # default if --logger not specified on command-line sub MAIN ( $filename ) { say 'Timer object ', $t; say 'Output object ', $o; say 'Remaining ARGS ', @*ARGS; say 'Filename ', $filename; } -- Hope this helps, Bruce Gray (Util of PerlMonks) https://www.enotes.com/shakespeare-quotes/by-pricking-my-thumbs

Perl and Raku Conference, late June, Las Vegas

2024-04-17 Thread Bruce Gray
ts/1c5qglk/raku_science_and_speakers_for_tprconference/ -- Hope to see you there, Bruce Gray (Util of PerlMonks)

Re: MacPorts Install of Parrot

2010-01-17 Thread Bruce Gray
cess. Note: I don't use MacPorts, and am guessing. -- Hope this helps, Bruce Gray

Re: Pack in perl6

2011-02-14 Thread Bruce Gray
specced to work differently than as I used it here, and so may change in the future. Buf.new should have a different API, and a Buf with size(1) should (I think) autopack 8 bits into a byte on output. -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: MAIN Sub

2011-02-16 Thread Bruce Gray
On Feb 16, 2011, at 4:14 PM, Bottoms, Christopher A wrote: Hello all, As soon as I add the MAIN sub to my module file, my test file complains: --snip-- In your module file, after the "use v6" line, add this line: module MaizeDiversity::Impute; -- Hope this helps, Bruce Gra

Re: Estimate for next Rakudo Star release?

2011-04-27 Thread Bruce Gray
tion of the rakudo.org site is taking up some key people's tuits today. Did I miss an announcement? No; I think that the announcement is waiting on the release itself. Preview: https://github.com/rakudo/star/tree/master/skel/docs/announce/ -- Hope this helps, Bruce Gray (Util on IRC)

Re: Parrot/Perl6 BOF at YAPC::NA 2011

2011-04-30 Thread Bruce Gray
On Apr 29, 2011, at 11:02 PM, Jon Gentle wrote: I'd like to take a minute and invite everyone to join us during YAPC::NA 2011 for a joint Parrot and Perl6 Birds of a Feather meeting and hackathon. I plan to attend both the BoF and Hackathon. Thanks for your efforts! -- Bruce Gray

Stickers of Parrot and Perl 6 for GSoC

2013-10-07 Thread Bruce Gray
://raw.github.com/perl6/mu/master/misc/camelia.txt ) 3. "Parrot speaks your language" is the obvious slogan to use for Parrot; it is already in the logo. Any recommendations on a slogan for the Perl 6 stickers? Just the text "Perl 6" is my default. -- Thank you,

Re: Stickers of Parrot and Perl 6 for GSoC

2013-10-07 Thread Bruce Gray
Patrick, Doh! They were right next to the ketchup in the fridge. and Yes, if you would send me the .ai file of Parrot, it would be very helpful. -- Much Thanks! Bruce Gray (Util of PerlMonks) On Oct 7, 2013, at 11:41 PM, "Patrick R. Michaud" wrote: > https://github.com/

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Bruce Gray
http://shop.oreilly.com/product/9780596100926.do Perl Testing: A Developer's Notebook by Ian Langworth and Chromatic From 2005, but still a fantastic primer on testing in Perl. — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How to get indirect access to a class attribute?

2015-03-25 Thread Bruce Gray
valid syntax, and your "a" method was *outside* your original "foo" class. — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Perl 6 Meetups in the Southeast US?

2015-05-07 Thread Bruce Gray
st meeting after YAPC::NA each year, those of us who attended present a “Highlights from YAPC” talk. By the way, I live in Auburn/Opelika, which is directly on the route from Niceville to Atlanta. We hope that you will come see us! — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How to do a substring replacement in Perl 6

2015-06-08 Thread Bruce Gray
l6 -e 'my $s = "abc"; substr-rw($s, 1,1) = "z"; say $s;' azc I also do not see substr-rw in doc.perl6.org. It needs to be added. In the meantime, you can find it here: http://design.perl6.org/S32/Str.html — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: How to do a substring replacement in Perl 6

2015-06-08 Thread Bruce Gray
l6 -e 'my $s = "abc"; substr-rw($s, 1,1) = "z"; say $s;' azc I also do not see substr-rw in doc.perl6.org. It needs to be added. In the meantime, you can find it here: http://design.perl6.org/S32/Str.html — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Mooch a regex

2016-01-12 Thread Bruce Gray
-perlvar#Variables_related_to_regular_expressions http://docs.perl6.org/type/Match https://github.com/Util/Blue_Tiger/blob/master/translate_regex.pl -- Hope this helps, Bruce Gray (Util on IRC and PerlMonks)

Re: Is there another way to define a regex?

2016-01-17 Thread Bruce Gray
> ; my $dir_re = / ^ @dirs_to_skip $ /; ... next if $line ~~ $dir_re; If you know that your exclusion list is always literal, you can leave the regex engine out of the process, and just do a hash lookup (which is even easier in Perl 6 with `set`, which sets the values all to `True`): my %dirs_to_skip = set < /home/user/.cpan /home/tbrowde/.emacs > ; ... next if %dirs_to_skip{$line}; -- Hope this helps, Bruce Gray (Util of PerlMonks)

Re: is there a Perl 5 converter?

2016-01-21 Thread Bruce Gray
clone git://github.com/Util/Blue_Tiger.git $ cd Blue_Tiger $ bin/p526 ../example.pl my @aaa = < a b c d e f g >; for @aaa <-> $c { print "$c$c$c\n"; } -- Hope this helps, Bruce Gray (Util on IRC)

Re: Google Summer of Code and Google Code In

2016-02-11 Thread Bruce Gray
s from both Perl 5 and Perl 6. — Hope this helps, Bruce Gray (Past GSOC Admin)

Re: parameters from the command line: how do they do that?

2017-06-23 Thread Bruce Gray
ded, I offer this just-uploaded video: https://www.youtube.com/watch?v=D16wa-gnFwE Brian Duggan - "Extending Perl 6 Command Line Argument Parsing using Metaprogramming” Brian covers the basics of “positional vs named parameters” around timemark 6m45s to 8m15s. — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: another one liner

2017-08-07 Thread Bruce Gray
raight translation: ifconfig | perl6 -e 'say lines().grep({/flags/}).map({.words.[0].subst(/":"$/, "")}).sort.[1]' P6-ish version: ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ }).sort[1]' — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: Suggestions on Learning Perl 6

2017-08-07 Thread Bruce Gray
p://www.jnthn.net/articles.shtml — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: .sub confusion

2018-04-30 Thread Bruce Gray
ith `.&` instead of `.` , like so: say %h.keys.grep(*.so)».sqrt.sum.&MyWickedSub.abs.&MySumTwister; This syntax is listed as "postfix .&", and can be found here: https://docs.perl6.org/language/operators#postfix_.&; So. `.` calls a method, and `.&` calls a sub as if the sub were a method. -- Hope this helps, Bruce Gray (Util)

Re: How to print colorized text to the terminal

2018-06-04 Thread Bruce Gray
$line { my Str $temp = $line; # if no <> surrounding $pattern it becomes literal. if $temp ~~ s/ (<$pattern>) /$color_red$0$color_off/ { say $temp; } } } — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: need sort help

2018-06-09 Thread Bruce Gray
er Way to do it: ls | perl6 -e '.say for lines().sort: { ( (/ (\d\d)"-"(\d\d)"-"(\d\d\d\d)"_"(\d\d)":"(\d\d)":"(\d\d) / ?? "$2$0$1$3$4$5" !! ""), $_ ) }' — Hope this helps, Bruce Gray (Util of Perlmonks)

Fwd: [DFW.pm] Sad News

2019-01-08 Thread Bruce Gray
> Begin forwarded message: > > From: Matthew Musgrove via DFW-pm > Subject: [DFW.pm] Sad News > Date: January 7, 2019 at 3:03:16 PM CST > To: corpuschristi...@pm.org, hous...@houston.pm.org, aus...@pm.org, > dfw...@pm.org > Cc: Matthew Musgrove > Reply-To: Dallas/Ft Worth Perl Mongers > > T

Re: I need hash inside a hash help

2019-01-11 Thread Bruce Gray
an anonymous *hash* constructor, which is what the curly braces do (when they are not doing their code-block-ish job). You could have also used `Hash(…)` or `%(…)` instead of `{…}`, but `{…} is shortest, and most traditional from Perl 5. — Hope this helps, Bruce Gray (Util of PerlMonks)

Re: I need hash inside a hash help

2019-01-11 Thread Bruce Gray
acct, $cn ) = %Vendors{"acme"}{"AccountNo", "ContactName”}; my ( $acct, $cn ) = %Vendors; say [:$acct, :$cn].perl; -- Hope this helps, Bruce Gray (Util of PerlMonks) > On Jan 11, 2019, at 1:25 PM, ToddAndMargo via perl6-users > wrote: > > On 1/1

Re: I need hash inside a hash help

2019-01-11 Thread Bruce Gray
> On Jan 11, 2019, at 1:39 PM, ToddAndMargo via perl6-users > wrote: > > On 1/11/19 11:33 AM, JJ Merelo wrote: >> I think you want $x, not $Ace. >> Cheers > > Yup. I am on fire today! :'( > > Still can't get it figured out. :'( :'( > > $ p6 'my $x="Ace"; my %Vendors=("acme" => { "Conta

Re: I need hash inside a hash help

2019-01-11 Thread Bruce Gray
;< $x >>` is to take the shortcut intended for constant keys, and bludgeon it to make it support variable keys, when the basic (and shorter) syntax of `%Vendors{$x}` handles the variable key naturally. — Hope this helps, Bruce Gray (Util of PerlMonks) > On Jan 11, 2019, at 1:

Re: subnet calculator

2019-01-11 Thread Bruce Gray
> On Jan 11, 2019, at 2:07 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Anyone know if someone has written a program like this > in Perl that will run locally and not require the Internet? > > http://www.subnet-calculator.com/ > > > Many thanks, > -T I have not used it, but

Re: I need hash string help

2019-01-11 Thread Bruce Gray
the snag, but was really a new set of problems that exists only in your example. FYI, every time that I have made this mistake, it was always due to my creating an example from scratch, instead of slowly massaging the real problem code down into a minimal form for public discussion. YMMV. I a

Re: filever.exe sub?

2019-01-31 Thread Bruce Gray
thing more that those two values; I see that just after them, the source code says: /* Brace thyselves */ To call those Windows APIs in Perl 6, you would use NativeCall. -- Hope this helps, Bruce Gray (Util of PerlMonks)