Re: Treating filehandles like strings

2000-08-09 Thread Bart Lateur
On 09 Aug 2000 09:40:29 +0100, Piers Cawley wrote: >> Now, what you can do, is stat() on the filehandle, and pick out the >> device ID and the inode number. That combination is unique for each >> file. > >And what happens when its a tied filehandle? Or are we going to >require that the tying clas

Re: Treating filehandles like strings

2000-08-09 Thread Piers Cawley
Bart Lateur <[EMAIL PROTECTED]> writes: > On Mon, 07 Aug 2000 17:43:29 -0700, Nathan Wiger wrote: > > >> I'd rather have a filehandle stringify to > >> the filename instead. > > > >Great minds think alike. :-) I was actually going to add this to the new > >version of the open() RFC as a possible

Re: Treating filehandles like strings

2000-08-08 Thread Jonathan Scott Duff
On Tue, Aug 08, 2000 at 11:44:10PM +0200, Bart Lateur wrote: > On Tue, 8 Aug 2000 16:32:26 -0500, Jonathan Scott Duff wrote: > > >I sincerely hope you really mean "Let's make ``open() or die'' > >optional" Exceptions should be integrated into the language but Ye > >Olde "returns undef on error"

Re: Treating filehandles like strings

2000-08-08 Thread Bart Lateur
On Tue, 8 Aug 2000 16:32:26 -0500, Jonathan Scott Duff wrote: >I sincerely hope you really mean "Let's make ``open() or die'' >optional" Exceptions should be integrated into the language but Ye >Olde "returns undef on error" should still be available as well. > > > try { $fh = open("foo")

Re: Treating filehandles like strings

2000-08-08 Thread Jonathan Scott Duff
On Tue, Aug 08, 2000 at 10:51:25PM +0200, Bart Lateur wrote: > On Tue, 8 Aug 2000 15:12:27 -0400, Bennett Todd wrote: > >and I'll breathe a big sigh of relief when I > >can just add "use Fatal qw(:all);" to the top of all my perl scripts > >and forever more ditch all the " or die ..." clauses. >

Re: Treating filehandles like strings

2000-08-08 Thread Bart Lateur
On Tue, 8 Aug 2000 15:12:27 -0400, Bennett Todd wrote: >One of the most valuable features was that the very large majority >of the helper routines I used, were simply wrappers around the >standard facilities, that didn't require any error checking: the >routine succeeded, or it printed a suitable

Re: Treating filehandles like strings

2000-08-08 Thread Bennett Todd
2000-08-07-20:43:29 Nathan Wiger: > > I'd rather have a filehandle stringify to > > the filename instead. > > Great minds think alike. :-) I was actually going to add this to the new > version of the open() RFC as a possible use of RFC 49's > soon-to-be-renamed STRING method. > > Now I know I h

Re: Treating filehandles like strings

2000-08-08 Thread Jon Ericson
Hildo Biersma wrote: > 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"

Re: Treating filehandles like strings

2000-08-08 Thread Hildo Biersma
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

Re: Treating filehandles like strings

2000-08-08 Thread Jon Ericson
Bart Lateur wrote: > On Mon, 07 Aug 2000 17:43:29 -0700, Nathan Wiger wrote: > >> I'd rather have a filehandle stringify to > >> the filename instead. > > > >Great minds think alike. :-) I was actually going to add this to the new > >version of the open() RFC as a possible use of RFC 49's > >soon-

Re: Treating filehandles like strings

2000-08-08 Thread Jonathan Scott Duff
On Tue, Aug 08, 2000 at 12:09:52PM +0200, Bart Lateur wrote: > On Mon, 07 Aug 2000 17:43:29 -0700, Nathan Wiger wrote: > > >> I'd rather have a filehandle stringify to > >> the filename instead. > > > >Great minds think alike. :-) I was actually going to add this to the new > >version of the open

Re: Treating filehandles like strings

2000-08-08 Thread Bart Lateur
On Mon, 07 Aug 2000 17:43:29 -0700, Nathan Wiger wrote: >> I'd rather have a filehandle stringify to >> the filename instead. > >Great minds think alike. :-) I was actually going to add this to the new >version of the open() RFC as a possible use of RFC 49's >soon-to-be-renamed STRING method. >

Re: Treating filehandles like strings

2000-08-07 Thread Nathan Wiger
> I'd rather have a filehandle stringify to > the filename instead. Great minds think alike. :-) I was actually going to add this to the new version of the open() RFC as a possible use of RFC 49's soon-to-be-renamed STRING method. Now I know I have at least I have one supporter! ;-) -Nate

Re: Treating filehandles like strings

2000-08-07 Thread Jon Ericson
[Reply to perl6-language-io as this is an I/O related.] Michael Mathews wrote: > > Here's a thought. Wouldn't this be cool (see below)? The idea is that in > Perl 6 you should be able to read from a file handle one character or one > line at a time (just like you can in Perl 5) BUT if you just g