Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 7:58 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 7:54 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     I use `slurp` all the ti

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 4:52 PM, Brandon Allbery wrote: The whole point of slurp is (possibly lazily in the future) reading everything. I was just hoping for 1002 ways of doing tings. If you want to read by bytes, it's the read method; by lines, it's get; for extended characters / graphemes, it's

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: I use `slurp` all the time, so of course, I can't make heads or tails out of https://docs.perl6.org/routine/slurp I want to

slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
Hi All, I use `slurp` all the time, so of course, I can't make heads or tails out of https://docs.perl6.org/routine/slurp I want to slurp the first 400 characters of a file and close the handle. Am I missing a `so many` parameter somewhere? Many thanks, -T

Re: websearches on "perl6"

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 11:06 AM, Elizabeth Mattijsen wrote: On 7 Oct 2018, at 18:31, Joseph Brenner wrote: Would anyone happen to know if there's a duckduckgo trick to get just perl6 links and not perl5? If you just append "perl6" it'll be mostly perl6 info in the top ten, but there tends to be at least

Re: What is the syntax of a reference pointer in p6?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 9:55 AM, Brandon Allbery wrote: He was thinking "don't make perl 5 as incompatible with perl 4". Pass-by-reference objects make for a major change to the language's behavior; it and its consequences are a large part of why perl 6 is incompatible with perl 5. Hi Brandon, I am glad

Re: What is the syntax of a reference pointer in p6?

2018-10-07 Thread ToddAndMargo via perl6-users
to get a performance boost.) On Sat, Oct 6, 2018 at 5:16 AM ToddAndMargo via perl6-users wrote: On 10/6/18 2:01 AM, JJ Merelo wrote: I don't know exactly what you mean by a reference pointer. If you mean a pointer, there's no such thing as a pointer, although there is some way to represent pointe

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 8:11 PM, Brandon Allbery wrote: Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>>

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 5:47 PM, Brad Gilbert wrote: I think the easiest way to get a 400 characters from a file is with .comb() on the file. 'example.txt'.IO.comb(400).head() On Sun, Oct 7, 2018 at 6:42 PM ToddAndMargo via perl6-users wrote: Hi All, I use `slurp` all the time, so of course, I can't

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 7:54 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     I use `slurp` all the time, so of course, I can't     make heads or tails out of    

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 8:13 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 8:11 PM, Brandon Allbery wrote: Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM

j ?

2018-10-07 Thread ToddAndMargo via perl6-users
Hi All, I am going to possibly be writing binary code to my terminal. This can really screw up your terminal. THe solution is to enter sane^j on your keyboard. The ^ above is holding down your key. I would like to be able to send that code at the end of the binary print, just in case.

Re: What is the syntax of a reference pointer in p6?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/6/18 3:20 AM, JJ Merelo wrote: No, we don't have that in Perl 6, explicitly so. Hi JJ, Yippee ! P6 is a wonderful clean up of P5. I hated having to send arrays to subroutines as pointers. What was Larry thinking !?!?!? ( He has redeemed himself 1000+ times over with P6.) -T

Re: How do I address bytes in a Buf/binary variable?

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 1:38 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 1:34 AM, Peter Pentchev wrote: On Mon, Oct 08, 2018 at 01:25:31AM -0700, ToddAndMargo via perl6-users wrote: Hi All! Question: I am using `read` to read the first 400 bytes of an unknown file (could be a binary file

How do I address bytes in a Buf/binary variable?

2018-10-08 Thread ToddAndMargo via perl6-users
Hi All! Question: I am using `read` to read the first 400 bytes of an unknown file (could be a binary file). The 400 bytes go into a variable of type "Buf". This is not a string. p6 'my $fh=open "/home/linuxutil/To", :r; my Buf $f = $fh.read( 400 ); $fh.close;' Now in $f, I want to look

Re: How do I address bytes in a Buf/binary variable?

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 1:34 AM, Peter Pentchev wrote: On Mon, Oct 08, 2018 at 01:25:31AM -0700, ToddAndMargo via perl6-users wrote: Hi All! Question: I am using `read` to read the first 400 bytes of an unknown file (could be a binary file). The 400 bytes go into a variable of type &quo

loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
$ p6 'my $fh=open "/home/linuxutil/To", :r; my Buf $f = $fh.read( 10 ); $fh.close; dd $f; for $f[0..*] -> $Byte { if $Byte == 0b00 {say "Binary"; last;}else{say $Byte}}' Buf[uint8] $f = Buf[uint8].new(87,111,114,100,80,114,111,0,0,0) 87 111 114 100 80 114 111 Binary To get the above to work,

Re: Could this be any more obscure?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/2/18 9:38 PM, David Green wrote: https://www.apress.com/gp/book/9781484228982 Is this something that better fits the way you think? Hi David, I really don't do well with such. Thank you for the tip anyway. -T

Re: flatten?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/2/18 5:31 PM, Tony Ewell wrote: Hi All, I have been using "flatten" for a while.  I kinda-sotra know what it means. From the following, https://docs.perl6.org/routine/[%20]#language_documentation_Operators   The Array constructor returns an itemized Array that does not  

Re: Could this be any more obscure?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/2/18 5:52 PM, David Green wrote: On 2018-10-02 6:28 pm, ToddAndMargo wrote: Question: in Perl syntaxland, is "postfix" short for "postcircumfix"? Again, search for "postcircumfix" in docs.perl6.org, and you will get this:

Re: bitwise paper?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/2/18 9:15 PM, David Green wrote: On 2018-10-02 9:57 pm, ToddAndMargo wrote: Does anyone know of a paper out in web land showing how to do bitwise operations? $ p6 'my $v = 32 & 16; say $v;' If you search docs.perl6.org for "bitwise" you will find "+&":

Re: <> thank you

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/5/18 5:24 AM, Brad Gilbert wrote: <> is part of the quoting sub-language Hi Brad, Thank you! I copied it into my keeper file on <> -T

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:14 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:06 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: $ p6 'my $fh=open "/home/linuxutil/To", :r; my Buf $f = $fh.read( 10 ); $fh.close; dd $f; for $f[0..*] -> $Byte { if $Byte == 0b

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:14 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:06 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: $ p6 'my $fh=open "/home/linuxutil/To", :r; my Buf $f = $fh.read( 10 ); $fh.close; dd $f; for $f[0..*] -> $Byte { if $Byte == 0b

Re: websearches on "perl6"

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:16 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 1:49 AM, Elizabeth Mattijsen wrote: https://www.nntp.perl.org/group/perl.perl6.users/2018/10/msg5957.html Actually, I was looking for the article you wrote about Perl 6 signatures.  And I was looking to see what else you had

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:50 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 4:25 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:21 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >     I never have to say `$str[0..*]` when looping over a string

Re: How do I address bytes in a Buf/binary variable?

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 1:46 AM, Peter Pentchev wrote: On Mon, Oct 08, 2018 at 01:38:54AM -0700, ToddAndMargo via perl6-users wrote: On 10/8/18 1:34 AM, Peter Pentchev wrote: On Mon, Oct 08, 2018 at 01:25:31AM -0700, ToddAndMargo via perl6-users wrote: Hi All! Question: I am using `read` to read

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:29 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 4:20 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 4:14 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:06 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     $ p6 'my $fh=open "/hom

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:25 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:21 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >     I never have to say `$str[0..*]` when looping over a string. Why? > > > How do you loop over a string? 

Re: loop on a Buf/binary

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:20 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 4:14 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:06 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     $ p6 'my $fh=open "/home/linuxutil/To", :r; my Buf $f = $fh.read( 10 );    

Re: websearches on "perl6"

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 1:49 AM, Elizabeth Mattijsen wrote: https://www.nntp.perl.org/group/perl.perl6.users/2018/10/msg5957.html :-)

Re: websearches on "perl6"

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 1:49 AM, Elizabeth Mattijsen wrote: https://www.nntp.perl.org/group/perl.perl6.users/2018/10/msg5957.html Actually, I was looking for the article you wrote about Perl 6 signatures. And I was looking to see what else you had written (as articles).

Re: websearches on "perl6"

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:20 AM, Elizabeth Mattijsen wrote: Both are mentioned in that email. On 8 Oct 2018, at 13:16, ToddAndMargo via perl6-users wrote: On 10/8/18 1:49 AM, Elizabeth Mattijsen wrote: https://www.nntp.perl.org/group/perl.perl6.users/2018/10/msg5957.html Actually, I was looking

Re: websearches on "perl6"

2018-10-08 Thread ToddAndMargo via perl6-users
On 10/8/18 4:19 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 4:16 AM, ToddAndMargo via perl6-users wrote: On 10/8/18 1:49 AM, Elizabeth Mattijsen wrote: https://www.nntp.perl.org/group/perl.perl6.users/2018/10/msg5957.html Actually, I was looking for the article you wrote about Perl 6

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On Fri, Oct 12, 2018 at 3:32 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, Why does this work $ p6 'sub RtnOrd( Str $Char --> Int ){return ord($Char)}; say RtnOrd "A";' 65 But this does not? $

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On Fri, Oct 12, 2018 at 3:32 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: But this does not? $ p6 'sub RtnOrd( Str $Char --> Str, Int ){return $Char, ord($Char)}; say RtnOrd "A";' ===SORRY!=== Error while compiling -e

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On 10/12/18 2:35 PM, Curt Tilmes wrote: On Fri, Oct 12, 2018 at 5:08 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >>     On 10/12/18 12:52 PM, Curt Tilmes wrote: >>      > You could make a subset for the List your're

need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
Hi All, Why does this work $ p6 'sub RtnOrd( Str $Char --> Int ){return ord($Char)}; say RtnOrd "A";' 65 But this does not? $ p6 'sub RtnOrd( Str $Char --> Str, Int ){return $Char, ord($Char)}; say RtnOrd "A";' ===SORRY!=== Error while compiling -e Malformed return

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On Fri, Oct 12, 2018 at 3:14 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >> On Fri, Oct 12, 2018 at 3:32 PM ToddAndMargo via perl6-users >> mailto:perl6-users@perl.org> <mailto:perl6-users@perl.org <mailto:pe

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On 10/12/18 3:27 PM, Curt Tilmes wrote: On Fri, Oct 12, 2018 at 6:23 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Is there any way to say I am return two things: a string and an integer? You can only return one thing, but that one thing can be a List th

Re: need --> help

2018-10-12 Thread ToddAndMargo via perl6-users
On Fri, Oct 12, 2018 at 11:23 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/12/18 2:35 PM, Curt Tilmes wrote: > > > On Fri, Oct 12, 2018 at 5:08 PM ToddAndMargo via perl6-users > mailto:perl6-users@perl.org> <mai

Malformed UTF-8 ???

2018-10-13 Thread ToddAndMargo via perl6-users
Hi All, if $StdOut { $ReturnStr = $$proc.out.slurp-rest; } gives me Malformed UTF-8 How do I clean up $$proc.out.slurp-rest ?? Many thanks, -T

Re: need --> help

2018-10-13 Thread ToddAndMargo via perl6-users
On 10/13/18 3:06 AM, Ralph Mellor wrote: That would work. I think it's more idiomatic to write the declaration as: my (Str $x, Int $y) = ... which saves repeating the `my`. -- raiph Thank you!

Malformed UTF-8 ???

2018-10-13 Thread ToddAndMargo via perl6-users
Hi All, if $StdOut { $ReturnStr = $$proc.out.slurp-rest; } gives me Malformed UTF-8 How do I clean up $$proc.out.slurp-rest ?? Many thanks, -T

Re: Malformed UTF-8 ???

2018-10-14 Thread ToddAndMargo via perl6-users
On 10/14/18 2:21 AM, Ralph Mellor wrote: OK. That makes sense. So the program that you're running for the $proc is producing malformed UTF8. Why don't you fix that rather than clean up afterwards? -- raiph Hi Raiph, I am reading the contents from a web page through my "curl" interface

Re: Malformed UTF-8 ???

2018-10-14 Thread ToddAndMargo via perl6-users
r $ReturnStr = ""; > $ReturnStr = 'foo'.IO.open.slurp-rest: enc => 'utf8-c8'; > say $ReturnStr; # bar > > -- > raiph > > On Sun, Oct 14, 2018 at 10:52 AM ToddAndMargo via perl6-users > mailto:perl6-users@perl.org>>

Re: Malformed UTF-8 ???

2018-10-14 Thread ToddAndMargo via perl6-users
On 10/13/18 3:02 AM, ToddAndMargo via perl6-users wrote: Hi All, if  $StdOut  { $ReturnStr = $$proc.out.slurp-rest; } gives me Malformed UTF-8 How do I clean up $$proc.out.slurp-rest ?? Many thanks, -T This does not work: if $StdOut { $ReturnStr = $$proc.out.slurp-rest( enc

What is |c ?

2018-10-14 Thread ToddAndMargo via perl6-users
Hi All, Over on https://docs.perl6.org/routine/slurp What is |c, as in multi sub slurp(IO::Handle:D $fh = $*ARGFILES, |c) multi sub slurp(IO() $path, |c) Many thanks, -T

enc ?

2018-10-14 Thread ToddAndMargo via perl6-users
Hi All, Over on https://docs.perl6.org/routine/slurp # read entire file as Latin1 Str my $text_contents = slurp "path/to/file", enc => "latin1"; Where is the list of my options for "enc"? Many thanks, -T

Re: Malformed UTF-8 ???

2018-10-14 Thread ToddAndMargo via perl6-users
On 10/14/18 3:08 AM, Ralph Mellor wrote: This code works fine: spurt 'foo', 'bar'; my Str $ReturnStr = ""; $ReturnStr = 'foo'.IO.open.slurp-rest: enc => 'utf8-c8'; say $ReturnStr; # bar Try it with my layout: $ReturnStr = $$proc.out.slurp-rest( enc => 'utf8-c8' );

Re: Malformed UTF-8 ???

2018-10-14 Thread ToddAndMargo via perl6-users
On Sun, Oct 14, 2018 at 10:35 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/14/18 2:29 AM, Ralph Mellor wrote: > In P6 "assign" means use of `=`. > > And "assign to" means to copy into the thing on the left of

Re: Malformed UTF-8 ???

2018-10-15 Thread ToddAndMargo via perl6-users
On 10/15/18 9:04 AM, Larry Wall wrote: On Sun, Oct 14, 2018 at 02:03:23AM -0700, ToddAndMargo via perl6-users wrote: : On 10/13/18 3:02 AM, ToddAndMargo via perl6-users wrote: : >Hi All, : > : > if  $StdOut  { $ReturnStr = $$proc.out.slurp-rest; } : > : >gives me : > : &g

Re: enc ?

2018-10-15 Thread ToddAndMargo via perl6-users
On Sun, Oct 14, 2018 at 10:23 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, Over on https://docs.perl6.org/routine/slurp # read entire file as Latin1 Str my $text_contents = slurp "path/to/file", enc => &

need :enc help?I

2018-10-15 Thread ToddAndMargo via perl6-users
Hi All, Over on: https://docs.perl6.org/routine/slurp This I understand enc => "latin1" What is :$enc ? Many thanks, -T

Re: Malformed UTF-8 ???

2018-10-16 Thread ToddAndMargo via perl6-users
My thinko.  Sorry. On Mon, Oct 15, 2018 at 9:40 PM Curt Tilmes mailto:c...@tilmes.org>> wrote: On Mon, Oct 15, 2018 at 9:34 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/15/18 9:04 AM, Larry Wall wrote: > Thi

Re: I need unprintable regex help

2018-10-21 Thread ToddAndMargo via perl6-users
I'm not sure what you thought I was showing you on IRC last night, since I pointed this out multiple times. On Sat, Oct 20, 2018 at 3:43 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, my Str $CrLf = chr(0x0d) ~ chr(0x0a); $

Re: Malformed UTF-8 ???

2018-10-19 Thread ToddAndMargo via perl6-users
On 10/16/18 3:59 AM, ToddAndMargo via perl6-users wrote: This is going through a rewrite.  So, don't help me until I clean this up.  I hope to have some time Friday, but maybe not.  I will get back. -T Rewrite worked! sub RunNoShellAll( Str $RunString, Bool $StdOut, Bool $StdErr, Bool

Issues with split

2018-10-19 Thread ToddAndMargo via perl6-users
Hi All, I am reading the output of curl https://www.bleepingcomputer.com/download/adwcleaner/ -o - and looping through it with split. This gets me about 1/20th of the lines: for split "\n", $WebPage -> $Line { AAAH! Doing a hex edit on the downloaded file, the delimiter is 0H0A

Re: Malformed UTF-8 ???

2018-10-19 Thread ToddAndMargo via perl6-users
On 10/19/18 7:58 PM, ToddAndMargo via perl6-users wrote: sub RunNoShellAll( Str $RunString, Bool $StdOut, Bool $StdErr, Bool $Code, --> List ) { Had to remove the --> List to get rid of the random core dumps https://github.com/rakudo/rakudo/issues/2403

Re: I need unprintable regex help

2018-10-21 Thread ToddAndMargo via perl6-users
On 10/20/18 10:49 PM, ToddAndMargo via perl6-users wrote: I'm not sure what you thought I was showing you on IRC last night Oh ya, and a string is not an array of characters. That comes from my Modula2 days.

Re: Malformed UTF-8 ???

2018-10-13 Thread ToddAndMargo via perl6-users
8 AM, Brad Gilbert wrote: Change the encoding to `utf8-c8` to let the invalid unicode through. or use binary methods. or make sure it isn't in some other encoding. On Sat, Oct 13, 2018 at 5:18 AM ToddAndMargo via perl6-users wrote: How do I change if $StdOut { $ReturnStr = $$proc.out.slurp-rest; } to utf8-c8?

I need unprintable regex help

2018-10-20 Thread ToddAndMargo via perl6-users
Hi All, my Str $CrLf = chr(0x0d) ~ chr(0x0a); $String ~~ s:global/ $CrLf /\n/; How do I get rid of the extra $CrLf variable? Many thanks, -T

Re: Malformed UTF-8 ???

2018-10-20 Thread ToddAndMargo via perl6-users
On 10/19/18 7:58 PM, ToddAndMargo via perl6-users wrote: if    $StdErr  { $proc  = run( @RunArray, :err, :out, :enc ); }    elsif $StdOut  { $proc  = run( @RunArray,   :out, :enc ); }  # STDERR goes to the terminal    else   { $proc  = run( @RunArray, :err, :out, :enc

Libre Office Calc

2018-11-04 Thread ToddAndMargo via perl6-users
Hi Al, I have been relegated to having to learn Libre Office's macro language (some kind of basic variant). Just out of curiosity, there are Python modules for Calc, does Perl 6 have anything? Many thanks, -T

Re: How do I Stringy a Buf?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 4:36 PM, ToddAndMargo via perl6-users wrote: $ p6 'my $fh=open "/home/linuxutil/WhoIsMySub.pl6", :r;  my Buf $f = $fh.read(100); $fh.close; say "<" ~ $f.decode("utf-8") ~ ">";' I changed `$f.decode("utf-8")` to `$f.decode("utf8-c8")` as you never know what a web page will have on it.

eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
Hi All, When reading a text file https://docs.perl6.org/routine/lines seems pretty straight forward. Question: How do I tell when I when I have reached the EOF (End Of File)? Many thanks, -T

Re: loop on a Buf/binary

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/8/18 5:33 AM, Curt Tilmes wrote: On Mon, Oct 8, 2018 at 7:53 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: I take it that `Buf` is a special type of array that the normal rules do not apply to. I would say rather than each of them (Buf and

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 1:02 AM, ToddAndMargo via perl6-users wrote: Hi All, When reading a text file     https://docs.perl6.org/routine/lines seems pretty straight forward. Question:  How do I tell when I when I have reached the EOF (End Of File)? Many thanks, -T Please expand the question to include

Re: j ?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/7/18 1:25 AM, ToddAndMargo via perl6-users wrote: Hi All, I am going to possibly be writing binary code to my terminal. This can really screw up your terminal.  THe solution is to enter sane^j on your keyboard.  The ^ above is holding down your key. I would like to be able

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
of file. #!/usr/bin/env perl6 given $*PROGRAM-NAME.IO.open {   while my $bytes = .read: 10 {     $bytes.say;   } } On Tue, Oct 9, 2018 at 10:17 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/9/18 1:02 AM, ToddAndMargo via perl6-users wrote: &g

How do I Stringy a Buf?

2018-10-09 Thread ToddAndMargo via perl6-users
Hi All, Yes, I know there are other ways to read a file. I have a specific reason for using `read`. How do I properly turn a Buf into a Str (all the bytes will have been tested to make sure they are printable first)? $ p6 'my $fh=open "/home/linuxutil/WhoIsMySub.pl6", :r; my Buf $f =

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
of file. #!/usr/bin/env perl6 given $*PROGRAM-NAME.IO.open { while my $bytes = .read: 10 { $bytes.say; } } On Tue, Oct 9, 2018 at 10:17 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/9/18 1:02 AM, ToddAndMargo via perl6-users wrote: &g

Re: How do I Stringy a Buf?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 6:26 AM, Curt Tilmes wrote: On Tue, Oct 9, 2018 at 9:21 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Yes, I know there are other ways to read a file.  I have a specific reason for using `read`. How do I properly turn a Buf into a St

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 6:22 AM, Curt Tilmes wrote: On Tue, Oct 9, 2018 at 8:49 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: I am not getting anywhere with `.lines`.  Read the whole thing in the first line. $ p6 'my $fh=open "/home/linuxutil/WhoIsMyS

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
Le mar. 9 oct. 2018 à 14:49, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> a écrit : On 10/9/18 5:42 AM, Fernando Santagata wrote: > The answer Laurent Roseenfeld gave you works for read and readchars as well. > Save the following lines in a file and

What is the syntax of a reference pointer in p6?

2018-10-06 Thread ToddAndMargo via perl6-users
What is the syntax of a reference pointer in p6?

Re: flatten?

2018-10-06 Thread ToddAndMargo via perl6-users
On 10/6/18 1:56 AM, JJ Merelo wrote: Posted as an issue to the perl6/docs repo https://github.com/perl6/doc/issues/2360 Just in case anyone wants to clarify... Cheers JJ You are the man!

Re: flatten?

2018-10-06 Thread ToddAndMargo via perl6-users
'@x' there > is a string literal, not the list @x. If you use << ... >> then it act > like double quotes, and will use the list instead. I am sorry.  With the top posting, I can't tell what you are talking about.  I also can't tell which o

Re: flatten?

2018-10-06 Thread ToddAndMargo via perl6-users
On 10/5/18 3:15 PM, Ralph Mellor wrote: Well I guess my first way of explaining it was a complete bust. :) It's not going to be worth me discussing your reply to my first attempt. List context means that something appears in the context of a list. For example, given the list of characters

Re: flatten?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/5/18 6:09 PM, Brandon Allbery wrote: That's where the | comes in. If you say     my @b = (1, |@a, 2); then you get (1, 'a', 'b', 'c', 2) like in Perl 5. But you can specify what gets flattened, so you can choose to flatten some arrays but not others if you need to for some reason:  

Re: flatten?

2018-10-05 Thread ToddAndMargo via perl6-users
I can't tell what you are talking about. I also can't tell which of the three question I asked that you are answering :'( On Fri, Oct 5, 2018 at 9:23 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/5/18 6:09 PM, Brandon Allbery wrote: > That's where

Re: flatten?

2018-10-05 Thread ToddAndMargo via perl6-users
On 10/5/18 3:15 PM, Ralph Mellor wrote: Well I guess my first way of explaining it was a complete bust. :) It's not going to be worth me discussing your reply to my first attempt. Hi Ralph, Thank you! I am going to have to save it for later and read it over REAL SLOW! :-) -T

Re: flatten?

2018-10-05 Thread ToddAndMargo via perl6-users
On Fri, Oct 5, 2018 at 7:44 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/5/18 3:15 PM, Ralph Mellor wrote: > Well I guess my first way of explaining it was a complete bust. :) > > It's not going to be worth me discussing your re

Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
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

**@args question

2019-01-02 Thread ToddAndMargo via perl6-users
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 --

Re: Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
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

Re: Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
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

Re: **@args question

2019-01-02 Thread ToddAndMargo via perl6-users
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 >>

Re: **@args question

2019-01-02 Thread ToddAndMargo via perl6-users
> 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

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
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-users@perl.org>> escribió: Hi All, Exactly what is type "Match"? Here I want $D0..$D3 to only be strings. And it thro

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
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

Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
Hi All, Exactly what is type "Match"? Here I want $D0..$D3 to only be strings. And it throws a match error. $ p6 'my $x="11.2.3.4"; my Str $D0; my Str $D1; my Str $D2; my Str $D3; $x~~m{ (<:N>) [.] (\d+) [.] (\d+) [.] (\d+) }; $D0 = $0; $D1 = $1; $D2 = $2; $D3 = $3; print "$D0 $D1 $D2

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
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

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
El jue., 20 dic. 2018 21:43, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> escribió: Hi All, Exactly what is type "Match"? Here I want $D0..$D3 to only be strings. And it throws a match error. $ p6 'my $x="11.2.3.4"; my Str $D0; my S

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
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

Re: Exactly what is type match?

2018-12-20 Thread ToddAndMargo via perl6-users
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!!

Re: Exactly what is type match?

2018-12-21 Thread ToddAndMargo via perl6-users
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

Re: Exactly what is type match?

2018-12-21 Thread ToddAndMargo via perl6-users
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";' > > 11 2 >

Re: Exactly what is type match?

2018-12-21 Thread ToddAndMargo via perl6-users
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 => (),

Re: Exactly what is type match?

2018-12-21 Thread ToddAndMargo via perl6-users
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

  1   2   3   4   5   6   7   8   9   10   >