chaining substitutions?

2017-09-22 Thread ToddAndMargo
Hi All, Question. Can I chain these two substitutions together? $ perl6 -e 'my $x="State : abc "; $x ~~ s/.*?" : "//; $x ~~ s/" ".*//; say "<$x>";' Many thanks, -T

Why can't I "write"?

2017-09-22 Thread ToddAndMargo
Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is not in binary mode. This: 48: my $Handle = o

Re: Why can't I "write"?

2017-09-22 Thread ToddAndMargo
On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is no

Re: Why can't I "write"?

2017-09-22 Thread Fernando Santagata
Hi, "write" is a method; its signature is method write(IO::Handle:D: Blob:D $buf --> True) so it has to be called as a method, not a sub. Also note the way the first argument is declared, as a IO::Handle:D:, without a comma separating it from the second argument. That's the type of the object t

overwrite?

2017-09-22 Thread ToddAndMargo
Hi All, I want to overwrite a file. Looking at: https://docs.perl6.org/routine/open I see ":truncate". This seems liek it will do the trick. Problem: I would like to read from the file first before truncating (ro). Is there a way to do this, or should I 1) open the handle with :ro 2) re

Re: Why can't I "write"?

2017-09-22 Thread ToddAndMargo
On Sat, Sep 23, 2017 at 8:19 AM, ToddAndMargo > wrote: On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write