Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:05 AM, Brent Laabs wrote: OK, a method is something you call on an object, using a the dot operator.  A subroutine is an independent object installed into your current lexical scope. If write was a sub, it would work exactly as you described:    48:   my $Handle = open( $Date

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:35 PM, Brandon Allbery wrote: On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery > wrote: On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote:       method write(IO::Handle:D: Blob:D $buf --> True) The

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery wrote: > On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo > wrote: > >> method write(IO::Handle:D: Blob:D $buf --> True) >> > > The key here is the colon *after* `IO::Handle:D`: that marks the Handle as > an invocant, i.e. this is a method to b

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo wrote: > method write(IO::Handle:D: Blob:D $buf --> True) > The key here is the colon *after* `IO::Handle:D`: that marks the Handle as an invocant, i.e. this is a method to be applied to an object. (The fact that it has a `type smiley`, i.e. an

Re: Why can't I "write"?

2017-09-23 Thread Brent Laabs
OK, a method is something you call on an object, using a the dot operator. A subroutine is an independent object installed into your current lexical scope. If write was a sub, it would work exactly as you described: 48: my $Handle = open( $DateFile, :rw ) 53: write( $Handle, $OldDateTime

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

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

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

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