Re: Treating filehandles like strings
[email protected] (Hildo Biersma) Tue, 08 Aug 2000 19:09:11 +0100
| Newsgroups | perl.perl6.language.io |
|---|---|
| Organization | Morgan Stanley Dean Witter & Co. |
| Message-ID | <[email protected]> |
Jon Ericson wrote:
>
> You misunderstand. I want to write this:
>
> open my $file, '/path/to/file' or die "can't open $file: $!";
> # code passes
> # /path/to/file is removed by another process
> # dang! what file did I open?
> print "I opened $file\n"; # ahh! that was it
As cool as this may be, it also inhibits us from using alternative
'to_string' operations on filehandles, including bytes read, position,
type (socket/pipe/file), etc. I'd rather see a more OO approach where
you'd have to do $file->{name}.
Hildo