Front page | perl.perl6.users |
Postings from June 2018
Re: IO ???
From: Xin Cheng
June 16, 2018 16:59
Re: IO ???
Message ID: 6EF2F696-E07E-4BF8-A567-58CB48366570@gmail.com
I am wondering why the IO::Path class doesn't have a "close" method. After I read from a file by
$filename.IO.lines -> $line;
Am I supposed to close the file, or it is automatically closed for me after the reading?
I tried something like
It is a runtime error. It seems to me that no need to close. Do I understand right? If so, why?
> On Jun 3, 2018, at 1:05 PM, ToddAndMargo <ToddAndMargo@zoho.com> wrote:
>>> On Sun, Jun 3, 2018 at 1:01 PM ToddAndMargo <ToddAndMargo@zoho.com <mailto:ToddAndMargo@zoho.com>> wrote:
>>> Hi All,
>>> I have a been looking around the docs pages and I am
>>> not finding a list of what the various IO functions do.
>>> I would like a list of IO.e does this and IO.d
>>> does that.
>>> Any such list exist?
>>> Many thanks,
> On 06/03/2018 10:03 AM, Brandon Allbery wrote:
>> It's a bit subtle to track down, but the IO method gives you an IO::Path object. https://docs.perl6.org/type/IO::Path
> I had found that, but I did not know what I was looking at.
> Thank you!