On Thu, Dec 20, 2018 at 5:17 PM ToddAndMargo via perl6-users
wrote:
El jue., 20 dic. 2018 21:43, ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> escribió:
Hi All,
Exactly what is type "Match"?
Here I want $D0..$D3 to only be strings. And it thro
On 12/20/18 2:59 PM, Laurent Rosenfeld via perl6-users wrote:
$0 /does /work with "perl6 -e" if you use correctly the tilde ~
operator. For example:
$ perl6 -e ' "abc" ~~ /.(\w)./; say ~$0;'
b
This is because "say" is also a converter. My issue
is when assigning to another variable that has
On 12/20/18 2:49 PM, Laurent Rosenfeld via perl6-users wrote:
$D0 = ~$0; $D1 = ~$1; # ...
Hi Laurent,
Except that it crashed in "perl6 -e", which is where I
do all my syntax testing. Is okay, Perl was 101 ways of
doing everything, so I can still "get 'er done".
I also instantly recognize .St
On 12/20/18 2:49 PM, Laurent Rosenfeld via perl6-users wrote:
JJ Merelo accurately responded
Absolutely. He just did not answer the question I asked.
JJ make a mistake? The earth would wobble on its access!!
On 12/20/18 3:51 PM, ToddAndMargo via perl6-users wrote:
On 12/20/18 2:49 PM, Laurent Rosenfeld via perl6-users wrote:
JJ Merelo accurately responded
Absolutely. He just did not answer the question I asked.
JJ make a mistake? The earth would wobble on its access!!
chuckle: Axis
On 12/21/18 12:58 AM, Laurent Rosenfeld via perl6-users wrote:
You're free to use a Str method call if you prefer, but using the ~ to
stringify $0 and the like works perfectly for me in perl -e ... context.
$ perl6 -e' "abc" ~~ /.(\w)./; put $0.perl; my $c = ~$0; put $c;'
Match.new(list => (),
On 12/20/18 10:32 PM, JJ Merelo wrote:
I didn't think I needed to answer a question that can be so easily
obtained from the documentation: https://docs.perl6.org/type/Match,
which, unsurprisingly, says: "|Match| objects are the result of a
successful regex match"
That I knew. I was looking
On 12/21/18 11:46 AM, Timo Paulssen wrote:
On 21/12/2018 20:38, ToddAndMargo via perl6-users wrote:
$ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{ (<:N>+) [.] (\d+)
}; $D0 ~$0; $D1 ~ $1; print "$D0 $D1\n";'
WARNINGS for -e:
Useless use of "~&
On 12/21/18 12:13 PM, Timo Paulssen wrote:
Like this? > > $ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{ (<:N>+) [.] >
(\d+)}; $D0 ~= $0; $D1 ~= $1; print "$D0 $D1\n";' > > 11 2 >
There's an important difference between "$D1 ~= $0" and "$D1 = ~$0".
They only do the same thing if $D0 (a
On 12/21/18 12:28 PM, ToddAndMargo via perl6-users wrote:
On 12/21/18 12:13 PM, Timo Paulssen wrote:
Like this? > > $ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{
(<:N>+) [.] >
(\d+)}; $D0 ~= $0; $D1 ~= $1; print "$D0 $D1\n";' > > 1
Dear Perl 6 Developers,
Fedora 29, x64
Xfce 4.13
$ perl6 -v
This is Rakudo version 2018.11 built on MoarVM version
2018.11 implementing Perl 6.d.
I am constantly improving (changing things) in my subs,
etc.. As such, the things I return often change.
Because of this, I have a found so
On 1/2/19 2:11 PM, Simon Proctor wrote:
Have you tried defining your return values in the signature?
sub AddThree( Int $a, Int $b, Int $c --> Int) {...}
With this the compiler knows what your function is supposed to return
and can earn you in advance.
I did and it blew up in my face so I sto
On 1/2/19 2:27 PM, ToddAndMargo via perl6-users wrote:
On 1/2/19 2:11 PM, Simon Proctor wrote:
Have you tried defining your return values in the signature?
sub AddThree( Int $a, Int $b, Int $c --> Int) {...}
With this the compiler knows what your function is supposed to return
and can e
On 1/2/19 4:00 PM, Brad Gilbert wrote:
You can only list one type as a return type.
If there were a hypothetical Tuple type:
sub AddThree( Int $a, Int $b, Int $c --> Tuple[Str, Int] {
my Int $d = $a + $b + $c;
return Tuple[Str,Int].new( "a+b+c=", $d );
}
I drew the
Hi All,
Looking at
https://docs.perl6.org/routine/print
I see
multi sub print(**@args --> True)
Question. If I wanted to create my own print routine
using **@args, how would I declare it?
sub printx( **@args data ) {...}
Many thanks,
-T
--
~~
> On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-users
> wrote:
>>
>> Hi All,
>>
>> Looking at
>>
>> https://docs.perl6.org/routine/print
>>
>> I see
>>
>> multi sub print(**@args --> True)
>>
>> Qu
On 1/2/19 10:17 PM, ToddAndMargo via perl6-users wrote:
> On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-users
> wrote:
>>
>> Hi All,
>>
>> Looking at
>>
>> https://docs.perl6.org/routine/print
>>
>> I see
>>
On 1/3/19 2:58 AM, Brad Gilbert wrote:
On Thu, Jan 3, 2019 at 12:43 AM ToddAndMargo via perl6-users
wrote:
On 1/2/19 10:17 PM, ToddAndMargo via perl6-users wrote:
> On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-users
> wrote:
>>
>> Hi All,
On 1/4/19 11:39 AM, ToddAndMargo via perl6-users wrote:
On 1/3/19 2:58 AM, Brad Gilbert wrote:
On Thu, Jan 3, 2019 at 12:43 AM ToddAndMargo via perl6-users
wrote:
On 1/2/19 10:17 PM, ToddAndMargo via perl6-users wrote:
> On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-us
On 1/3/19 12:43 AM, Richard Hainsworth wrote:
The term "slurpy" did help a lot.
:-)
I am writing your explanation down for my records.
Well Golly!
$ p6 'sub printx(**@args){print(@args)}; printx("abc",1,"def\n");'
abc 1 def
$ p6 'sub printx(**@args){print @args, "\n"}; printx("abc",1,"d
On 1/3/19 1:52 AM, JJ Merelo wrote:
El mié., 2 ene. 2019 a las 21:04, ToddAndMargo via perl6-users
(mailto:perl6-us...@perl.org>>) escribió:
Dear Perl 6 Developers,
Fedora 29, x64
Xfce 4.13
$ perl6 -v
This is Rakudo version 2018.11 built on MoarVM v
Hi All,
I would like to do a Send Notify when a program of mine
crashes.
How do I trap a crash?
Is there a way to see some of the local variables in the
sub that crashes with the trap?
Many thanks,
-T
--
~~
Computers are like air conditioners.
They malfun
Hi All,
How do I do a hash inside a hash?
So far I have:
$ p6 'my %Vendors=("acme" => ( "ContactName" => "Larry, "AccountNo" =>
1234 ) ); say %Vendors;'
===SORRY!=== Error while compiling -e
I want to be able to have both a Contact Name and and AccountNo
associated with each key in %Vendors
thanks,
>> -T
On 1/11/19 10:56 AM, Elizabeth Mattijsen wrote:
Perhaps https://docs.perl6.org/language/exceptions#Catching_exceptions could be
enlightening?
On 11 Jan 2019, at 18:54, ToddAndMargo via perl6-users
wrote:
Yes. Thank you!
CATCH {
default {
$*ERR.say: .pay
n front of the ()
The working code looks like this:
perl6 -e 'my %Vendors=("acme" => %( "ContactName" => "Larry",
"AccountNo" => 1234 ) ); say %Vendors;'
{acme => {AccountNo => 1234, ContactName => Larry}}
Hope that helps!
- T
On 1/11/19 11:07 AM, JJ Merelo wrote:
What would you say is the error, according to where the arrow points to?
Maybe some unclosed double quotes?
El vie., 11 ene. 2019 a las 19:57, ToddAndMargo via perl6-users
(mailto:perl6-us...@perl.org>>) escribió:
Hi All,
How do I do
On 1/11/19 11:12 AM, ToddAndMargo via perl6-users wrote:
On 1/11/19 11:09 AM, Timo Paulssen wrote:
Hi Todd,
the error you're getting comes from a closing quotation mark missing
after "Larry
You will also need to give perl6 some hint that you want the list of
pairs to actually bec
On 1/11/19 11:16 AM, Bruce Gray wrote:
On Jan 11, 2019, at 12:41 PM, ToddAndMargo via perl6-users
wrote:
Hi All,
How do I do a hash inside a hash?
So far I have:
$ p6 'my %Vendors=("acme" => ( "ContactName" => "Larry, "AccountNo" => 1
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" => { "ContactName" => "Larry",
"AccountNo" => 1234 }, "Ace" => { "ContactName" => "Mo", "AccountNo" =>
On 1/11/19 11:39 AM, 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&quo
On 1/11/19 11:43 AM, ToddAndMargo via perl6-users wrote:
On 1/11/19 11:39 AM, 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. :'( :'(
$
On 1/11/19 11:50 AM, Bruce Gray wrote:
'my $x = "Ace"; my %Vendors = ( acme => { ContactName => "Larry", AccountNo => 1234 }, Ace => { ContactName =>
"Mo", AccountNo => "A102" } ); say %Vendors{$x} ~ "\t" ~ %Vendors{$x};’
Hi Bruce,
Sweet! Thank you!
$ p6 'my $x = "Ace"; my %Vendors = ( acme
On 1/11/19 11:45 AM, Bruce Gray wrote:
Short answer: use `%hash{$var}`, not `%hash<$var>`.
When they are not in position to be less-than and greater-than comparison
operators, the pair of left and right angle brackets are a circumfix operator
that work like Perl 5’s “quote word” op: `qw()`.
I
On 1/11/19 11:50 AM, ToddAndMargo via perl6-users wrote:
On 1/11/19 11:43 AM, ToddAndMargo via perl6-users wrote:
On 1/11/19 11:39 AM, 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
On 1/11/19 11:59 AM, Bruce Gray wrote:
That may work, but is bad practice.
no fooling! look like hell too
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
On Fri, Jan 11, 2019 at 3:08 PM ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> 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
On 1/11/19 1:56 PM, Bruce Gray wrote:
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
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
"Larry" ); $y= %Vendors; say $y;'
Type check failed in assignment to $y; expected Str but got Any (Any)
in block at -e line 1
$ p6
On 1/11/19 5:08 PM, ToddAndMargo via perl6-users wrote:
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
"Larry" ); $y= %Vendors; say $y;'
T
On 1/11/19 5:59 PM, Tom Browder wrote:
On Fri, Jan 11, 2019 at 19:09 ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> wrote:
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y;
On 1/11/19 6:23 PM, Tom Browder wrote:
On Fri, Jan 11, 2019 at 20:15 ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> wrote:
...
> $p6 'my $x = "acme"; my %Vendors = ( acme => { ContactName => "Larry",
> AccountNo => 1234 } ); m
On 1/11/19 6:35 PM, Bruce Gray wrote:
On Jan 11, 2019, at 7:08 PM, ToddAndMargo via perl6-users
wrote:
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName => &qu
say $a before $b; # True
There are useful methods on Versions
my $a = v12.3.4.1;
say $a.parts.perl; # (12, 3, 4, 1)
On Fri, Jan 11, 2019 at 8:12 PM ToddAndMargo via perl6-users
wrote:
On 1/11/19 5:08 PM, ToddAndMargo via perl6-users wrote:
Hi All,
Now what am I doi
On 1/11/19 6:51 PM, ToddAndMargo via perl6-users wrote:
On 1/11/19 6:49 PM, Brad Gilbert wrote:
$a is short for $a{'a','b'}
This also happens in string literals
my $a = { a => 1, b => 2 };
say "$a"; # 1 2
say "$a{'a','b
Hi All,
This works:
$ p6 'my $x="2018-09-15"; $x~~s/ (<:N>+) "-" (<:N>+) "-" (<:N>+)
/$0.$1.$2/; say $x;'
2018.09.15
And this does too:
$ perl6 -e 'my Str $Date=DateTime.now.Str; $Date~~m/ (<:N>+) "-" (<:N>+)
"-" (<:N>+) "T" .* /; print "$Date\n\t$0 $1 $2\n"'
2019-01-12T14:35:23.242587-
On 1/12/19 3:04 PM, Timo Paulssen wrote:
On 12/01/2019 23:40, ToddAndMargo via perl6-users wrote:
But this does not. What is wrong with (<:N>**2) ?
$ perl6 -e 'my Str $Date=DateTime.now.Str; $Date~~m/ (<:N>**4) "-"
(<:N>**2) "-" (<:Nl>**2) &q
On 1/12/19 3:04 PM, Timo Paulssen wrote:
On 12/01/2019 23:40, ToddAndMargo via perl6-users wrote:
But this does not. What is wrong with (<:N>**2) ?
$ perl6 -e 'my Str $Date=DateTime.now.Str; $Date~~m/ (<:N>**4) "-"
(<:N>**2) "-" (<:Nl>**2) &q
On 1/13/19 2:04 PM, Brad Gilbert wrote:
<:Nl> matches a Number that is letter-like
Hi Brad and Timo,
Now I understand. It is for non-Arabic numbers such
as Roman numerals.
Thank you!
-T
Hi All,
Windows provides a utility called filever.exe which will
tell you the revision of and exe file. (You can also see this
through the gui with properties).
Currently I run filever.exe through Wine. It is cumbersome,
especially since Wine floods STDERR. I work around it.
Do we have a mod
On 1/29/19 9:53 PM, ToddAndMargo via perl6-users wrote:
Hi All,
Windows provides a utility called filever.exe which will
tell you the revision of and exe file. (You can also see this
through the gui with properties).
Currently I run filever.exe through Wine. It is cumbersome,
especially
On 1/29/19 9:53 PM, ToddAndMargo via perl6-users wrote:
Hi All,
Windows provides a utility called filever.exe which will
tell you the revision of and exe file. (You can also see this
through the gui with properties).
Currently I run filever.exe through Wine. It is cumbersome,
especially
On 2/1/19 10:02 AM, Timo Paulssen wrote:
On 01/02/2019 01:33, Bruce Gray wrote:
To call those Windows APIs in Perl 6, you would use NativeCall.
Don't forget that Todd wanted to use this on non-windows with not-wine.
NativeCall on linux won't run windows code all by itself.
That said, wine is
On 2/1/19 4:26 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 10:02 AM, Timo Paulssen wrote:
On 01/02/2019 01:33, Bruce Gray wrote:
To call those Windows APIs in Perl 6, you would use NativeCall.
Don't forget that Todd wanted to use this on non-windows with not-wine.
NativeCall on
On 2/1/19 6:24 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 4:26 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 10:02 AM, Timo Paulssen wrote:
On 01/02/2019 01:33, Bruce Gray wrote:
To call those Windows APIs in Perl 6, you would use NativeCall.
Don't forget that Todd wanted t
Hi All,
On a type Buf, what do I use to check for the
position of a byte pattern?
Many thanks,
-T
On 2/1/19 7:22 PM, ToddAndMargo via perl6-users wrote:
Hi All,
On a type Buf, what do I use to check for the
position of a byte pattern?
Many thanks,
-T
Basically, what am I doing wrong here?
$ p6 'my $handle=open("filever.exe", :bin, :ro); my Buf $b; $b=
$handle.read(5);
>
> On Fri, Feb 1, 2019 at 9:22 PM ToddAndMargo via perl6-users
> wrote:
>>
>> Hi All,
>>
>> On a type Buf, what do I use to check for the
>> position of a byte pattern?
>>
>>
>> Many thanks,
>> -T
On 2/1/19 7:35 PM, Brad Gilbert
On 2/1/19 7:37 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 7:22 PM, ToddAndMargo via perl6-users wrote:
Hi All,
On a type Buf, what do I use to check for the
position of a byte pattern?
Many thanks,
-T
Basically, what am I doing wrong here?
$ p6 'my $handle=open("filever.
> On Fri, Feb 1, 2019 at 9:37 PM ToddAndMargo via perl6-users
> wrote:
>>
>> On 2/1/19 7:22 PM, ToddAndMargo via perl6-users wrote:
>>> Hi All,
>>>
>>> On a type Buf, what do I use to check for the
>>> position of a byte pattern?
>>
On 2/1/19 8:03 PM, ToddAndMargo via perl6-users wrote:
> On Fri, Feb 1, 2019 at 9:37 PM ToddAndMargo via perl6-users
> wrote:
>>
>> On 2/1/19 7:22 PM, ToddAndMargo via perl6-users wrote:
>>> Hi All,
>>>
>>> On a type Buf, what do I use to
On 2/1/19 8:07 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 8:03 PM, ToddAndMargo via perl6-users wrote:
> On Fri, Feb 1, 2019 at 9:37 PM ToddAndMargo via perl6-users
> wrote:
>>
>> On 2/1/19 7:22 PM, ToddAndMargo via perl6-users wrote:
>>> Hi All,
>&g
On 2/1/19 8:26 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 8:07 PM, ToddAndMargo via perl6-users wrote:
On 2/1/19 8:03 PM, ToddAndMargo via perl6-users wrote:
> On Fri, Feb 1, 2019 at 9:37 PM ToddAndMargo via perl6-users
> wrote:
>>
>> On 2/1/19 7:22 PM, ToddAndMar
Hi All,
How do I use chr inside a regex. In the below, how
do I get rid of $y?
$ p6 'my Str $x=chr(0x66)~chr(0x77); my Str $y=chr(0x66)~chr(0x77);
$x~~s/ $y /xy/; say $x;'
xy
Many thanks,
-T
On 2/1/19 11:32 PM, JJ Merelo wrote:
Hi,
El sáb., 2 feb. 2019 a las 7:48, ToddAndMargo via perl6-users
(mailto:perl6-us...@perl.org>>) escribió:
Hi All,
How do I use chr inside a regex. In the below, how
do I get rid of $y?
$ p6 'my Str $x=chr(0x66)~chr(0x77)
Hi All,
Is there a way to modify this to start reading at
a specific index? And include how many bytes (300)
to read as well?
my $FileHandle = open( $FileName, :bin, :ro );
my Buf $BinaryFile = $FileHandle.read( 300 );
Many thanks,
-T
Hi All,
What is the fastest way to find the index of
a sub string in a string?
-T
:
https://github.com/rakudo/rakudo/blob/master/src/core/Str.pm6#L255-L284
- .indices:
https://github.com/rakudo/rakudo/blob/master/src/core/Str.pm6#L206-L252
- .contains:
https://github.com/rakudo/rakudo/blob/master/src/core/Str.pm6#L183-L203
- .rindex:
https://github.com/rakudo/rakudo/blob/master/sr
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,
Is there a way to modify this to start reading at
a specific index? And include how many bytes (300)
to read as well?
my $FileHandle = open( $FileName, :bin
> On Fri, Feb 1, 2019 at 11:02 PM ToddAndMargo via perl6-users>
wrote:
>>
>> On 2/1/19 8:26 PM, ToddAndMargo via perl6-users wrote:
>>> On 2/1/19 8:07 PM, ToddAndMargo via perl6-users wrote:
>>>> On 2/1/19 8:03 PM, ToddAndMargo via perl6-users wrote:
&
Hi All,
I need to read a file into a buffer (NO CONVERSIONS!)
and then convert it to a string (again with no
conversions).
I have been doing this:
for ( @$BinaryFile ) -> $Char { $StrFile ~= chr($Char); }
But it takes a bit of time. What is the fastest way to do this?
I guess there is not
Hi All,
I need to read a file into a buffer (NO CONVERSIONS!)
and then convert it to a string (again with no
conversions).
I have been doing this:
for ( @$BinaryFile ) -> $Char { $StrFile ~= chr($Char); }
But it takes a bit of time. What is the fastest way to do this?
I guess there is not
On 2/2/19 6:09 AM, Brad Gilbert wrote:
sub buf-index ( Buf $buf, +@match ) {
my $elems = @match.elems;
$buf.rotor( $elems => 1 - $elems ).first(* eqv @match.List, :k)
}
my $buf = Buf[uint8].new(0x4D, 0x5A, 0x90, 0x00, 0x03);
say buf-index( $buf, (0x90, 0x00
>
> On Sat, Feb 2, 2019 at 9:23 PM ToddAndMargo via perl6-users
> wrote:
>>
>> Hi All,
>>
>> I need to read a file into a buffer (NO CONVERSIONS!)
>> and then convert it to a string (again with no
>> conversions).
>>
>> I have been doing
> 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.rotor( $elems
Hi All,
Was the subroutine "index" written Perl6? If so,
where can I view the source code?
Many thanks,
-T
> 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,
>>>>
>>
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
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
Note that they heavily 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. :'(
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 = "s
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 th
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)
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
On 2/3/19 8:46 PM, Norman Gaywood wrote:
On Mon, 4 Feb 2019 at 15:12, ToddAndMargo via perl6-users
mailto:perl6-us...@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
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 th
Seq ) {
my List $Matcher = $SubBuf.List;
my Int $Elems = $Matcher.elems;
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:
ample.
That is not how Bufs are stored in Perl6 at all.
They are 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 `r
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 buf-index(Blob
On Sun, Feb 3, 2019 at 9:36 PM ToddAndMargo via perl6-users
mailto:perl6-us...@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
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
Ind
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
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-us...@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,
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-us...@perl.org>> wrote:
Hi All,
If I have a variable of type Buf which 1000 bytes
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-us...@perl.org>> wrote:
Hi All,
> 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
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" goe
actice [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
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
On Wed, Feb 6, 2019 at 1:02 PM ToddAndMargo via perl6-users
mailto:perl6-us...@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&q
1 - 100 of 1666 matches
Mail list logo