Re: I need one liner module import help

2019-06-13 Thread ToddAndMargo via perl6-users
On 6/13/19 1:49 AM, JJ Merelo wrote: Hi, El jue., 13 jun. 2019 a las 9:39, ToddAndMargo via perl6-users (mailto:perl6-users@perl.org>>) escribió: On 6/11/19 3:39 PM, ToddAndMargo via perl6-users wrote: > This works: > > perl6 -e 'use lib "/home/l

Re: I need one liner module import help

2019-06-13 Thread ToddAndMargo via perl6-users
On 6/11/19 3:39 PM, ToddAndMargo via perl6-users wrote: This works: perl6 -e 'use lib "/home/linuxutil/p6lib"; use PrintColors :PrintBlue; PrintBlue( "Blue\n" );' Blue Just posted: RFE: -M switch for selective imports https://github.com/perl6/doc/issues/2852

Re: I need one liner module import help

2019-06-12 Thread ToddAndMargo via perl6-users
On 6/12/19 2:51 PM, Tom Browder wrote: I think you will have to file a Rakudo issue. Do you have a link to them?

Re: I need one liner module import help

2019-06-12 Thread ToddAndMargo via perl6-users
Hi Bruce, This has to do with the way I am importing subs from modules. When importing subs, I like to declare which subs I am importing. Otherwise my code is a nightmare to maintain. "Where the heck did that subs comes from? Is its a system subs or " For instance, in Perl 5: use

Re: I need one liner module import help

2019-06-12 Thread ToddAndMargo via perl6-users
On 6/11/19 9:11 PM, Bruce Gray wrote: On Jun 11, 2019, at 5:39 PM, ToddAndMargo via perl6-users wrote: Hi All, I need one liner help importing a module sub This works: perl6 -e 'use lib "/home/linuxutil/p6lib"; use PrintColors :PrintBlue; PrintBlue( "Blue\n" );

I need one liner module import help

2019-06-11 Thread ToddAndMargo via perl6-users
Hi All, I need one liner help importing a module sub This works: perl6 -e 'use lib "/home/linuxutil/p6lib"; use PrintColors :PrintBlue; PrintBlue( "Blue\n" );' Blue This does not: perl6 -I /home/linuxutil/p6lib -M "PrintColors :PrintBlue" -e 'PrintBlue( "Blue\n" );' Could not find

Re: Need help with a regex

2019-05-07 Thread ToddAndMargo via perl6-users
> On Mon, May 06, 2019 at 07:12:39PM -0700, Tony Ewell via perl6-users wrote: >> Hi All, >> >> What am I doing wrong here? >> >> $ p6 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$1USD/; say $x;' >> USD1.23 >> >> I am expecting to see `1.23USD` >> >> Many thanks, >> -T On 5/7/19 3:05 PM, Patrick R.

Re: Need help with a regex

2019-05-07 Thread ToddAndMargo via perl6-users
On Tue, 7 May 2019 at 13:10, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, What am I doing wrong here? $ p6 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$1USD/; say $x;' USD1.23 I am expecting to see `1.23USD` Many thanks

Re: Need help with a regex

2019-05-06 Thread ToddAndMargo via perl6-users
On Tue, 7 May 2019 at 13:10, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, What am I doing wrong here? $ p6 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$1USD/; say $x;' USD1.23 I am expecting to see `1.23USD` Many th

Need help with a regex

2019-05-06 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here? $ p6 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$1USD/; say $x;' USD1.23 I am expecting to see  `1.23USD` Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when you open windows

RFE: compiler bug to fix

2019-04-30 Thread ToddAndMargo via perl6-users
Dear Perl 6 Developers, Fedora 29 $ rpm -qa rakudo* rakudo-zef-0.7.1-1.fc29.x86_64 rakudo-0.2019.03-1.fc29.x86_64 Whether this is a bug or a Request for Enhancement, I do not know. I will leave that up to you. I have moved to "selective importing of subs from modules". sub abc( ...)

Re: library search path ?

2019-04-30 Thread ToddAndMargo via perl6-users
On 4/29/19 3:50 AM, Timo Paulssen wrote: you can use these one-liners:     perl6 -e '.say for $*REPO.repo-chain'     perl6 -e '.perl.say for $*REPO.repo-chain' Hi Timo, Thank you! Just out of curiosity, what is ap# nqp# perl5# -T

Re: library search path ?

2019-04-29 Thread ToddAndMargo via perl6-users
On 4/29/19 3:50 AM, Timo Paulssen wrote: you can use these one-liners:     perl6 -e '.say for $*REPO.repo-chain'     perl6 -e '.perl.say for $*REPO.repo-chain' Hi Timo, Thank you! Just out of curiosity, what is ap# nqp# perl5# -T

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 4:26 PM, ToddAndMargo via perl6-users wrote: On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks

library search path ?

2019-04-28 Thread ToddAndMargo via perl6-users
Hi All, Could not find xxx::yyy at line zz in: file#/home/linuxutil/p6lib inst#/home/tony/.perl6 inst#/usr/lib64/perl6/site inst#/usr/lib64/perl6/vendor inst#/usr/lib64/perl6 ap# nqp# perl5# If I remember correctly, there was a way to ask Perl 5 for a list of

Re: How do I fix this zef error?

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 12:45 AM, ToddAndMargo via perl6-users wrote: $ perl6 --stagestats GetUpdates.pl6 Stage start  :   0.000 Stage parse  : ===SORRY!=== Could not find Net::SMTP at line 18 in: $ zef install  Net::SMTP ===SORRY!=== Failed to open file /usr/lib64/perl6/site/dist

What is the proper way to path a module in a non-standard directory

2019-04-28 Thread ToddAndMargo via perl6-users
Apparently use lib 'path' is not the correct way. And especially not in a module itself that calls other modules.

What is the proper way to path a module in a non-standard directory

2019-04-28 Thread ToddAndMargo via perl6-users
Apparently use lib 'path' is not the correct way. And especially not in a module itself that calls other modules.

Something happened to the chat line

2019-04-28 Thread ToddAndMargo via perl6-users
Hi All, Going to https://docs.perl6.org/ and clicking on "Chat with us" https://docs.perl6.org/webchat.html gives Page not found... yet! None of these routes could generate a response for your GET request for /webchat.html, maybe you need to add a new one? Please fix!

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 2:21 AM, Timo Paulssen wrote: the strace command ended up only tracing the shell script "perl6", which very quickly execs moar, at which point strace considers its job done. there was barely any output at all for that reason. fortunately we can just add -f to the strace command so

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/27/19 10:40 PM, David Christensen wrote: We discussed this at our San Francisco Perl Mongers meeting today: Any Perl 5 guys there? And did they get "grouchy" with you for using Perl 6? Did they call Perl 6 "Java" by any chance? Chuckle.

How do I fix this zef error?

2019-04-28 Thread ToddAndMargo via perl6-users
$ perl6 --stagestats GetUpdates.pl6 Stage start : 0.000 Stage parse : ===SORRY!=== Could not find Net::SMTP at line 18 in: $ zef install Net::SMTP ===SORRY!=== Failed to open file /usr/lib64/perl6/site/dist/863D6AAB4F5E7259BA381C4EBE0F88BAA358090E: No such file or directory

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 12:01 AM, Timo Paulssen wrote: especially if it iterates your entire home directory Don't think so $ rm -rf ~/.perl6/precomp $ perl6 --stagestats GetUpdates.pl6 Stage start : 0.000 Stage parse : 13.201 Stage syntaxcheck: 0.000 Stage ast: 0.000 Stage

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
Hi Timo, This tell you anything? $ perl6 --stagestats GetUpdates.pl6 Stage start  :   0.000 Stage parse  :  13.150 Stage syntaxcheck:   0.000 Stage ast    :   0.000 Stage optimize   :   0.351 Stage mast   :   1.133 Stage mbc    :   0.019 Stage moar   :   0.000

Re: precomp?

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/27/19 9:01 PM, Gene Nardi wrote: Hey. I’m just glad it doesn’t take a whole day for a run anymore. Like in the old days. Gene Nardi Sent from my iPhone I hated punch cards!

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
> On 21/04/2019 05:58, ToddAndMargo via perl6-users wrote:>> Hi All, >> >> One liners are fast, but my own programs are very slow to start. >> >> I download >> >> https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 >> >&

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/27/19 10:40 PM, David Christensen wrote: What is your operating system? Fedora 29 x64 Xfce 4.13 $ uname -r 5.0.7-200.fc29.x86_64 What is your Perl 6? $ rpm -qa rakudo rakudo-0.2019.03-1.fc29.x86_64 Also tried: https://github.com/nxadm/rakudo-pkg/releases

Re: Why so slow

2019-04-27 Thread ToddAndMargo via perl6-users
On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks

Re: precomp?

2019-04-27 Thread ToddAndMargo via perl6-users
ize takes 10 seconds to start >> >> Many thanks, >> -T On 4/26/19 8:39 PM, Brad Gilbert wrote: Only modules get precompiled currently. If you want your code to get precompiled, put most of it into a module. On Fri, Apr 26, 2019 at 9:58 PM ToddAndMargo via perl6-users wrote:

precomp?

2019-04-26 Thread ToddAndMargo via perl6-users
Hi All, What exactly is the purpose of the ".precomp" directory? "Precompile?". Is there a way to get it to speed up the start of my programs? Right now anything of anything with any amount of size takes 10 seconds to start Many thanks, -T

Re: Help! Upgrade broke -M

2019-04-25 Thread ToddAndMargo via perl6-users
On 4/23/19 7:27 PM, ToddAndMargo via perl6-users wrote: Hi All, Okay, I am, in trouble.  I just upgraded from     rakudo-pkg-Fedora29-2018.11-01.x86_64.rpm to     rakudo-pkg-Fedora29-2019.03.1-01.x86_64.rpm and now I bomb on all my "use lib's". Virtually everything I have wri

Re: Bug: pm and pm6 get mixed up

2019-04-24 Thread ToddAndMargo via perl6-users
On Tue, Apr 23, 2019 at 9:33 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, I found out the hard way after upgrading Perl 6 $ perl6 -v This is Rakudo version 2019.03 built on MoarVM version 2019.03 implementing Perl 6.d. That 2019.

Re: Why so slow

2019-04-24 Thread ToddAndMargo via perl6-users
d and > install the modules itself.) > > Also it isn't until the very last line of that program that anything > visible happens. > > Basically it has a lot of work to do before it can make itself visible. > > On Wed, Apr 24, 2019 at 2:46 AM ToddAndMargo via perl6-users

Why so slow

2019-04-24 Thread ToddAndMargo via perl6-users
Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks, -T

RFE: module extension defaults

2019-04-23 Thread ToddAndMargo via perl6-users
Dear Perl 6 Developers: Would you please consider the following Request for Enhancement. There is a regression bug in 2019.03 where Perl 6 can no longer tell the difference between Perl 5 modules (*.pm) and Perl 6 modules (*.pm6). It loads "pm" before "pm6". RFE: please set Perl 6 to only

Bug: pm and pm6 get mixed up

2019-04-23 Thread ToddAndMargo via perl6-users
Hi All, I found out the hard way after upgrading Perl 6 $ perl6 -v This is Rakudo version 2019.03 built on MoarVM version 2019.03 implementing Perl 6.d. That 2019.03 can no longer tell the difference between Perl 5 modules (*.pm) and Perl 6 modules (*.pm6) and will read in the Perl 5 module

Help! Upgrade broke -M

2019-04-23 Thread ToddAndMargo via perl6-users
Hi All, Okay, I am, in trouble. I just upgraded from rakudo-pkg-Fedora29-2018.11-01.x86_64.rpm to rakudo-pkg-Fedora29-2019.03.1-01.x86_64.rpm and now I bomb on all my "use lib's". Virtually everything I have written bombs. $ ls CurlUtils* CurlUtils.pm6 $ perl6

gtk widget?

2019-04-23 Thread ToddAndMargo via perl6-users
Hi All, I see https://github.com/perl6/gtk-simple/tree/master/examples but I have no clue what is going on. Is there some kind of gtk widget that you can graphically design these windows with? Many thanks, -T -- ~ I am Windows I am the Blue Screen of Death No one

Re: Why so slow?

2019-04-23 Thread ToddAndMargo via perl6-users
On 4/21/19 6:32 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks

Re: Why so slow?

2019-04-23 Thread ToddAndMargo via perl6-users
On 4/22/19 4:21 AM, ToddAndMargo via perl6-users wrote: On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple

Re: gtk widget?

2019-04-23 Thread ToddAndMargo via perl6-users
On 4/22/19 2:22 AM, mimosin...@gmail.com wrote: Missatge de ToddAndMargo via perl6-users del dia dl., 22 d’abr. 2019 a les 5:44: I see https://github.com/perl6/gtk-simple/tree/master/examples but I have no clue what is going on. Is there some kind of gtk widget that you can graphically

Re: gtk widget?

2019-04-23 Thread ToddAndMargo via perl6-users
> On 22/04/2019 05:44, ToddAndMargo via perl6-users wrote: >> Hi All, >> >> I see >> >> https://github.com/perl6/gtk-simple/tree/master/examples >> >> but I have no clue what is going on. >> >> Is there some kind of gtk widget that you

Re: Why so slow?

2019-04-22 Thread ToddAndMargo via perl6-users
On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out

Re: Why so slow?

2019-04-22 Thread ToddAndMargo via perl6-users
On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks

gtk widget?

2019-04-21 Thread ToddAndMargo via perl6-users
Hi All, I see https://github.com/perl6/gtk-simple/tree/master/examples but I have no clue what is going on. Is there some kind of gtk widget that you can graphically design these windows with? Many thanks, -T -- ~ I am Windows I am the Blue Screen of Death No one

Why so slow?

2019-04-21 Thread ToddAndMargo via perl6-users
Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks, -T

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 Tw

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: lp0

2019-03-10 Thread ToddAndMargo via perl6-users
ons shouldn't normally be writing to explicit device IDs. On 3/10/19, ToddAndMargo via perl6-users wrote: Hi Parrot, I mean writing directly to /dev/lp0. This is my example that does not work as I have a kernel problem with lp0 at the moment: p6 '"/dev/lp0".IO.spurt( "abc&q

lp0

2019-03-09 Thread ToddAndMargo via perl6-users
Hi All, How do I output data to a printer on /dev/lp0 (LPT1)? Many thanks, -T

Re: valid values?

2019-03-04 Thread ToddAndMargo via perl6-users
On 3/3/19 8:29 PM, Brad Gilbert wrote: It should be sub mysub(Int $value where 1|2|4|8|16) { say "Got $value" } :-)

Re: valid values?

2019-03-03 Thread ToddAndMargo via perl6-users
On 3/3/19 4:09 AM, Fernando Santagata wrote: On Sun, Mar 3, 2019 at 11:41 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: That way I can catch bad values at compile time and not have to wait and see what it gets fed. The snippet I showed you doesn't inte

Re: valid values?

2019-03-03 Thread ToddAndMargo via perl6-users
> On Sun, Mar 3, 2019 at 11:09 AM ToddAndMargo via perl6-users > mailto:perl6-users@perl.org>> wrote: > > Hi All, > > I want to pass an integer to a sub. The only > valid values of the integer are 1, 2, 4, 8, and 16. > > Other tha

valid values?

2019-03-03 Thread ToddAndMargo via perl6-users
Hi All, I want to pass an integer to a sub. The only valid values of the integer are 1, 2, 4, 8, and 16. Other than using "if" to test their values, is there a way to state that an integer can only have certain predefined values? Many thanks, -T -- ~~~ Having been

Re: .payload

2019-03-01 Thread ToddAndMargo via perl6-users
On 3/1/19 11:58 AM, ToddAndMargo via perl6-users wrote: On 2/28/19 3:46 AM, ToddAndMargo via perl6-users wrote: Follow up.  Thank yo for the Help!  My rewrite: CATCH {    # Reference: https://docs.perl6.org/language/exceptions#Catching_exceptions    my $Message = .message;    my

Re: .payload

2019-03-01 Thread ToddAndMargo via perl6-users
On 2/28/19 3:46 AM, ToddAndMargo via perl6-users wrote: Follow up. Thank yo for the Help! My rewrite: CATCH { # Reference: https://docs.perl6.org/language/exceptions#Catching_exceptions my $Message = .message; my $Message2; # for $Payload.comb -> $y { print "$y=&q

Re: .payload

2019-02-28 Thread ToddAndMargo via perl6-users
On 28/02/2019 12:46, ToddAndMargo via perl6-users wrote: Hi All, https://docs.perl6.org/language/exceptions#Catching_exceptions I am trying to place .payload into a variable `my $Payload = .payload;` CATCH {    # Reference: https://docs.perl6.org/language/exceptions#Catching_exceptions

.payload

2019-02-28 Thread ToddAndMargo via perl6-users
Hi All, https://docs.perl6.org/language/exceptions#Catching_exceptions I am trying to place .payload into a variable `my $Payload = .payload;` CATCH { # Reference: https://docs.perl6.org/language/exceptions#Catching_exceptions my $NotifyStr; my $Payload = .payload; default {

Re: subs and variables speed question

2019-02-11 Thread ToddAndMargo via perl6-users
On 11/02/2019 07:12, ToddAndMargo via perl6-users wrote: WHERE is pretty sweet command! $ p6 'sub a (Buf $b) { say $b.WHERE.base(0x10) }; my $c = Buf.new(1,2,3); say $c.WHERE.base(0x10); a($c);' 7F385D41334C 7F385D41334C On 11/02/2019 12:16, ToddAndMargo via perl6-users wrote: On 2/11/19

Re: subs and variables speed question

2019-02-11 Thread ToddAndMargo via perl6-users
probably have a better result with .WHICH for what you want to achieve. On 11/02/2019 07:12, ToddAndMargo via perl6-users wrote: WHERE is pretty sweet command! $ p6 'sub a (Buf $b) { say $b.WHERE.base(0x10) }; my $c = Buf.new(1,2,3); say $c.WHERE.base(0x10); a($c);' 7F385D41334C 7F385D41334C

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
On 2/9/19 2:28 PM, ToddAndMargo via perl6-users wrote: On 2/9/19 1:56 PM, ToddAndMargo via perl6-users wrote: Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T Without all

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
On 2/9/19 2:28 PM, ToddAndMargo via perl6-users wrote: On 2/9/19 1:56 PM, ToddAndMargo via perl6-users wrote: Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T Without all

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
WHERE is pretty sweet command! $ p6 'sub a (Buf $b) { say $b.WHERE.base(0x10) }; my $c = Buf.new(1,2,3); say $c.WHERE.base(0x10); a($c);' 7F385D41334C 7F385D41334C

Re: subs and variables speed question

2019-02-09 Thread ToddAndMargo via perl6-users
On 2/9/19 1:56 PM, ToddAndMargo via perl6-users wrote: Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T Without all the typos: Hi All, sub xxx( Buf $YugeBuf is ro ) {some

subs and variables speed question

2019-02-09 Thread ToddAndMargo via perl6-users
Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/8/19 1:37 PM, Kevin Pye wrote: Unpack is very useful if you have multiple items you want to unpack, and if you're familiar with the Perl 5 unpack then there's the P5pack module (which isn't a full implementation of Perl 5's unpack, but is useful for simpler things). If you want to unpack

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/8/19 1:37 PM, Kevin Pye wrote: Unpack is very useful if you have multiple items you want to unpack, and if you're familiar with the Perl 5 unpack then there's the P5pack module (which isn't a full implementation of Perl 5's unpack, but is useful for simpler things). If you want to unpack

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/8/19 9:54 AM, Brad Gilbert wrote: If you have a new enough version of Rakudo: my Buf $x=Buf.new(0xAE,0x5D,0x5C,0x72); my int32 $i = $x.read-int32(0,LittleEndian); say $i.base(16); # 725C5DAE Thank you!

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/8/19 2:59 AM, The Sidhekin wrote:   The "elegant" way I'd do it, is using unpack(): https://docs.perl6.org/routine/unpack   It's experimental, so a declaration is needed, but Buf does Blob, so otherwise, it's straight to the point: $ perl6 -e 'use experimental :pack; my Buf

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/8/19 2:34 AM, Simon Proctor wrote: There's probably a nicer way but I don't generally play about with this sort of thing. :16([~] $x.reverse.map( *.base(16) )) It does involve lots of String manipulation, as I say. There's probably a better way. Thank you!

Re: buf to integer?

2019-02-08 Thread ToddAndMargo via perl6-users
On 2/7/19 10:35 PM, Todd Chester via perl6-users wrote: Hi All, I am dealing with a Buf what includes 32 bit integers, but they are entered somewhat backwards as view with hexedit: AE 5D 5C 72 represents the number 725C5DAE This is what I have come up with to convert this type of number in a

Re: shift left syntax?

2019-02-08 Thread ToddAndMargo via perl6-users
>> >> Hi All, >> >> Is this the only way to shift left? >> >> $i = $i +< 0x01 >> >> $ p6 'my int32 $i=0x5DAE; say $i.base(0x10); $i = $i +< 0x01; say >> $i.base(0x10);' >> >> 5DAE >> BB5C >> >> >> Does we have any of those fancy += ~= ways of doing it? >> >> Many thanks, >> -T On

print hex?

2019-02-07 Thread ToddAndMargo via perl6-users
Hi All, What is the easiest way to get both print and say to print $i below in Hex? $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;' Buf:0x 23982 Many thanks, -T

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/6/19 12:17 PM, yary wrote: On Wed, Feb 6, 2019, 11:57 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> said What would be the most practice way of converting a string to and array of characters Brad said- You should be using `comb` if you want a list of char

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
On Wed, Feb 6, 2019 at 1:02 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 2/6/19 12:58 PM, Patrick R. Michaud wrote: > On Wed, Feb 06, 2019 at 12:38:01PM -0800, ToddAndMargo via perl6-users wrote: >> $ p6 'my Str $x="abcd";

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/6/19 12:58 PM, Patrick R. Michaud wrote: On Wed, Feb 06, 2019 at 12:38:01PM -0800, ToddAndMargo via perl6-users wrote: $ p6 'my Str $x="abcd"; for $x.comb.kv -> $i, $j {say "Index <$i> = <$j> = ord <" ~ ord($j) ~ ">";}' Index <0>

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
practice [practical] way of converting a string to and array of characters? $x="abc" goes to @y[0]="a", @y[1]="b", @y[2]="c" On 2/6/19 12:12 PM, Laurent Rosenfeld via perl6-users wrote: Brad told you already: use comb. Le mer. 6 févr. 2019 à 20:57, To

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/6/19 5:19 AM, Brad Gilbert wrote: The reason there is a Nil, is you asked for the ord of an empty string. "".ord =:= Nil The reason there are two empty strings is you asked for them. What would be the most practice way of converting a string to and array of characters? $x="abc"

Re: split and nils?

2019-02-06 Thread ToddAndMargo via perl6-users
> On Tue, Feb 5, 2019 at 11:05 PM ToddAndMargo via perl6-users > wrote: >> >> Hi All, >> >> What is with the starting ending Nils? There are only four >> elements, why now six? >> >> And how to I correct this? >> >> $ p6

Re: reassigning values to variables question

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/6/19 12:44 AM, ToddAndMargo via perl6-users wrote: On 2/5/19 11:56 PM, ToddAndMargo via perl6-users wrote: On 2/5/19 8:34 PM, ToddAndMargo via perl6-users wrote: On Sun, Feb 3, 2019 at 9:36 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     Hi All,   

Re: reassigning values to variables question

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/5/19 11:56 PM, ToddAndMargo via perl6-users wrote: On 2/5/19 8:34 PM, ToddAndMargo via perl6-users wrote: On Sun, Feb 3, 2019 at 9:36 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     Hi All,     If I have a variable of type Buf which 1000

Re: reassigning values to variables question

2019-02-06 Thread ToddAndMargo via perl6-users
On 2/5/19 8:34 PM, ToddAndMargo via perl6-users wrote: On Sun, Feb 3, 2019 at 9:36 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     Hi All,     If I have a variable of type Buf which 1000 bytes in it     and I find the five bytes I want, is it faster,

VS_VERSION_INFO?

2019-02-05 Thread ToddAndMargo via perl6-users
Hi All, Anyone know how to find the pointer to VS_VERSION_INFO in a Windows .exe file? Supposedly, this link tells you but .. https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#section-table-section-headers Many thanks, -T

split and nils?

2019-02-05 Thread ToddAndMargo via perl6-users
Hi All, What is with the starting ending Nils? There are only four elements, why now six? And how to I correct this? $ p6 'my Str $x="abcd"; for split( "",@$x ).kv -> $i,$j { say "Index <$i> = <$j> = ord <" ~ ord($j) ~ ">";}' Use of Nil in string context in block at -e line 1

Re: reassigning values to variables question

2019-02-05 Thread ToddAndMargo via perl6-users
On Sun, Feb 3, 2019 at 9:36 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, If I have a variable of type Buf which 1000 bytes in it and I find the five bytes I want, is it faster, slower, or no difference in speed to overwrite th

Re: binary test and position?

2019-02-05 Thread ToddAndMargo via perl6-users
On 2/5/19 8:26 AM, Curt Tilmes wrote: If you have glibc (probably yes for Linux or Mac, probably no for Windows), you can call memmem(): use NativeCall; sub memmem(Blob $haystack, size_t $haystacklen,            Blob $needle,   size_t $needlelen --> Pointer) is native {} sub

Re: binary test and position?

2019-02-05 Thread ToddAndMargo via perl6-users
declared with `is repr('VMArray')` which basically means they are stored as C arrays. On Tue, Feb 5, 2019 at 1:47 AM ToddAndMargo via perl6-users wrote: On 2/2/19 9:29 PM, Brad Gilbert wrote: Subs do not need to have a `return` statement if it is returning the last value. You also broke the ret

Re: binary test and position?

2019-02-04 Thread ToddAndMargo via perl6-users
return $Buffer.rotor($Elems => 1- $Elems).grep(* eqv $Matcher, :k); } } On Sat, Feb 2, 2019 at 10:05 PM ToddAndMargo via perl6-users wrote: On 2/2/19 6:09 AM, Brad Gilbert wrote: sub buf-index ( Buf $buf, +@match ) { my $elems = @match.elems; $buf

reassigning values to variables question

2019-02-03 Thread ToddAndMargo via perl6-users
Hi All, If I have a variable of type Buf which 1000 bytes in it and I find the five bytes I want, is it faster, slower, or no difference in speed to overwrite the same variable with the five bytes? Or is it faster to put the five bytes from the first variable into a second variable? Many

Re: "read" options?

2019-02-03 Thread ToddAndMargo via perl6-users
On 2/3/19 8:46 PM, Norman Gaywood wrote: On Mon, 4 Feb 2019 at 15:12, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: https://docs.perl6.org/routine/read Where is the list of the options this thing will take, such as :ro and :bin? Those are options fo

"read" options?

2019-02-03 Thread ToddAndMargo via perl6-users
Hi All, https://docs.perl6.org/routine/read Where is the list of the options this thing will take, such as :ro and :bin? Many thanks, -T

Re: decode options?

2019-02-03 Thread ToddAndMargo via perl6-users
On 2/3/19 4:56 PM, ToddAndMargo via perl6-users wrote: Hi All, Uhhh,     https://docs.perl6.org/routine/decode    role Blob    From Blob    (Blob) method decode    Defined as:    multi method decode(Blob:D: Str:D $encoding = 'UTF-8' --> Str:D)    Appl

Re: Fastest way to convert from a Buf to a Str?

2019-02-03 Thread ToddAndMargo via perl6-users
On 2/3/19 5:26 PM, Darren Duncan wrote: On 2019-02-02 7:22 PM, ToddAndMargo via perl6-users wrote: I need to read a file into a buffer (NO CONVERSIONS!) and then convert it to a string (again with no conversions). I think you're making an impossible request. Don't forget that I think

decode options?

2019-02-03 Thread ToddAndMargo via perl6-users
Hi All, Uhhh, https://docs.perl6.org/routine/decode role Blob From Blob (Blob) method decode Defined as: multi method decode(Blob:D: Str:D $encoding = 'UTF-8' --> Str:D) Applies an encoding to turn the blob into a Str. my Blob $blob =

Re: "index" source code?

2019-02-03 Thread ToddAndMargo via perl6-users
ly use NQP opcodes, so you shouldn't try and copy them. On Sun, Feb 3, 2019 at 12:35 AM ToddAndMargo via perl6-users wrote: Hi All, Was the subroutine "index" written Perl6? If so, where can I view the source code? Many thanks, -T Thank you! The nqp op codes do seem way over my head. :'(

Re: binary test and position?

2019-02-03 Thread ToddAndMargo via perl6-users
On 2/2/19 9:29 PM, Brad Gilbert wrote: It is also weird that you are using CamelCase for variables, and a mixture of CamelCase and snake-case for the subroutine name. Hi Brad, An explanation. I do this for "maintainability". I have been able to "type" since high school typing class. Upper

Re: Fastest way to convert from a Buf to a Str?

2019-02-03 Thread ToddAndMargo via perl6-users
On 2/3/19 1:55 AM, David Warring wrote: Are all characters in the range 0-255, ie latin-1 characters? You could then try: my $str =  $buf.decode("latin-1"); There's one potential  issue if your data could contain DOS end of lines ("\r\n"), which will get translated to a single logical "\n" in

Re: Start reading at a specific index?

2019-02-02 Thread ToddAndMargo via perl6-users
> On Sat, Feb 2, 2019 at 9:02 PM ToddAndMargo via perl6-users > wrote: >> >> On 2/2/19 3:16 AM, Shlomi Fish wrote: >>> On Sat, 2 Feb 2019 01:08:39 -0800 >>> ToddAndMargo via perl6-users wrote: >>> >>>> Hi All, >>>> >>

"index" source code?

2019-02-02 Thread ToddAndMargo via perl6-users
Hi All, Was the subroutine "index" written Perl6? If so, where can I view the source code? Many thanks, -T

  1   2   3   4   5   6   7   8   9   10   >