Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Hildo Biersma
> =head1 DESCRIPTION > > For easier portability, the default input record separator should > at least match /\015?\012/, so that the following works on as many > platforms as possible: > > while () { > do_stuff_with_only_one_line_or_manually_buffered_lines; > } > > I don't know

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-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: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Chaim Frenkel
Please explain in what way "\n" is not safe on all platforms? On all platforms, the actual line seperators are translated (except under binmode()) to "\n". If you do decide to switch to binmode() you are in non-portable territory. > "PRL" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes

Re: RFC 51 (v2) Angle brackets should accept filenames a

2000-08-09 Thread Chaim Frenkel
What does $foo = <"filename">;# 1 $bar = <"another">; $gaz = <"filename>; # 2 Does #2 get the second line or the first? Can the <> contain a function? Your example seems to indicate that it can. But if it is hard for me to parse visually, I'm not sure how easy i

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Nathan Wiger
> It occurs to me that one could embed the class name right in the first > argument: > > $perl = open 'ftp://ftp.linux.activestate.com/pub/staff/gsar/APC/' > or die "ActiveState ftp site is hosed again: $!"; Yeah, the next version is going to include a syntax that's very similar to this, a

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Simply Hao
Hildo, I knew it was an incomplete proposal and was waiting to hear reactions, keeping in mind Unicode support. Thanks for reminding me of Larry's previous post. I will also update the RFC to document the problem more completely. -Hao

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Bart Lateur
On 09 Aug 2000 10:34:27 -0400, Chaim Frenkel wrote: >Please explain in what way "\n" is not safe on all platforms? > >On all platforms, the actual line seperators are translated (except >under binmode()) to "\n". Try processing a Mac file on Unix, or vice versa. You'll soon see why. Your schem

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Chaim Frenkel
That wasn't what the original RFC was discussing. There was no mention of cross-platform line-ending support. Because I can validly embed a "^M" into my unix text file and it will be quite valid. Under the RFC proposal I will suddenly get an unexpected line ending. The problems of intuiting li

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Bart Lateur
On 09 Aug 2000 12:00:55 -0400, Chaim Frenkel wrote: >There was no mention of cross-platform line-ending support. >I suggested a while ago on p5p an improved binmode(), that might do >such magic among other things. Then it should do the *inverse* thing that binmode() does. This magic should only

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 07:41:54AM -0700, Nathan Wiger wrote: > > It occurs to me that one could embed the class name right in the first > > argument: > > > > $perl = open 'ftp://ftp.linux.activestate.com/pub/staff/gsar/APC/' > > or die "ActiveState ftp site is hosed again: $!"; > > Yeah,

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Graham Barr
On Wed, Aug 09, 2000 at 07:41:54AM -0700, Nathan Wiger wrote: > > It occurs to me that one could embed the class name right in the first > > argument: > > > > $perl = open 'ftp://ftp.linux.activestate.com/pub/staff/gsar/APC/' > > or die "ActiveState ftp site is hosed again: $!"; > > Yeah,

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Graham Barr
On Wed, Aug 09, 2000 at 11:41:42AM -0500, Jonathan Scott Duff wrote: > How about this? > > open '/etc/passwd'; # file OK > open '/usr/local/bin/'; # directory (note the trailing '/') Portability, not all platforms use / > open 'ftp://ftp.perl.org/'; #

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Casey R. Tweten
Today around 3:54pm, Graham Barr hammered out this masterpiece: : On Wed, Aug 09, 2000 at 07:41:54AM -0700, Nathan Wiger wrote: : > > It occurs to me that one could embed the class name right in the first : > > argument: : > > : > > $perl = open 'ftp://ftp.linux.activestate.com/pub/staff/gsar/

Re: RFC 51 (v2) Angle brackets should accept filenames a

2000-08-09 Thread Jon Ericson
Chaim Frenkel wrote: > What does > > $foo = <"filename">;# 1 > $bar = <"another">; > $gaz = <"filename>; # 2 ^ add " here > Does #2 get the second line or the first? $gaz contains the second line. Otherwise this: while (<'filename'>

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Chaim Frenkel
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: BL> On 09 Aug 2000 12:00:55 -0400, Chaim Frenkel wrote: >> There was no mention of cross-platform line-ending support. >> I suggested a while ago on p5p an improved binmode(), that might do >> such magic among other things. BL> Then it shoul

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Nick Ing-Simmons
Graham Barr <[EMAIL PROTECTED]> writes: >On Wed, Aug 09, 2000 at 11:41:42AM -0500, Jonathan Scott Duff wrote: >> How about this? >> >> open '/etc/passwd'; # file > >OK > >> open '/usr/local/bin/'; # directory (note the trailing '/') > >Portability, not all platforms

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Bart Lateur wrote: > On 09 Aug 2000 12:00:55 -0400, Chaim Frenkel wrote: > > >There was no mention of cross-platform line-ending support. > > >I suggested a while ago on p5p an improved binmode(), that might do > >such magic among other things. > > Then it should do the *in

Re: RFC 51 (v2) Angle brackets should accept filenames a

2000-08-09 Thread Chaim Frenkel
> "JE" == Jon Ericson <[EMAIL PROTECTED]> writes: JE> Chaim Frenkel wrote: >> What does >> >> $foo = <"filename">;# 1 >> $bar = <"another">; >> $gaz = <"filename>; # 2 JE>^ add " here >> Does #2 get the second line or the first? JE> $gaz contains the sec

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Chaim Frenkel
> "BCW" == Bryan C Warnock <[EMAIL PROTECTED]> writes: BCW> Isn't that what the nebulous line disciplines are supposed to handle? Has anyone taken on RFCing line disciplines? -- Chaim FrenkelNonlinear Knowledge, Inc. [EMAIL PROTECTED]

Re: RFC 51 (v2) Angle brackets should accept filenames a

2000-08-09 Thread Jon Ericson
Chaim Frenkel wrote: > > "JE" == Jon Ericson <[EMAIL PROTECTED]> writes: > JE> $gaz contains the second line. Otherwise this: > > JE> while (<'filename'>){print;}; > > JE> won't work. This gets a little hairy, I admit. > > Actually they are two different problems. The while loop can be

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Graham Barr <[EMAIL PROTECTED]> wrote: > On Wed, Aug 09, 2000 at 11:41:42AM -0500, Jonathan Scott Duff wrote: > > > open 'ftp://ftp.perl.org/'; # ftp > > What user/password does it use Whatever you put in the URL with anonymous as default. > >

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Tom Hughes <[EMAIL PROTECTED]> wrote: > The suggested syntax does not necessarily conflict with the > above - the core might spot the xxx: scheme and try and load > an xxx.pm from some well known path and hand off the open to > that module. To follow up t

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Chaim Frenkel
Fits right in with my (yech) suggestion of haveing a registry of all installed modules. This could handle the locating of the correct versioned module, we could add the open handlers. Though is there a way of making it versioned? (Do we need to?) open "ftp(version=1,author=NIS)://"

Re: RFC 51 (v2) Angle brackets should accept filenames a

2000-08-09 Thread Chaim Frenkel
> "JE" == Jon Ericson <[EMAIL PROTECTED]> writes: >> @foo = lazy grep >> while( <@foo> ) { ... } JE> What does lazy grep do? How does this apply? lazy would set the rest of arguments to be lazily evaluated. An iterator that would call the function until the results are exhusted. --

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Chaim Frenkel wrote: > BCW> Isn't that what the nebulous line disciplines are supposed to handle? > > Has anyone taken on RFCing line disciplines? I haven't seen anything on them, but everyone seems to be in agreement that we're going to have them. If no one else wants to b

Summary of I/O related RFCs

2000-08-09 Thread Jon Ericson
=head1 Summary of I/O related RFCs Please correct my misunderstandings and omitions. This (or something like it) should be sent up to perl6-language. =over =item 2 (v1): Request For New Pragma: Implicit (language) Values in void context would be printed to the default filehandle. use impl

Re: RFC 69 (v1) Standardize input record separator (for

2000-08-09 Thread Chaim Frenkel
> "BCW" == Bryan C Warnock <[EMAIL PROTECTED]> writes: BCW> On Wed, 09 Aug 2000, Chaim Frenkel wrote: BCW> Isn't that what the nebulous line disciplines are supposed to handle? >> >> Has anyone taken on RFCing line disciplines? BCW> I haven't seen anything on them, but everyone seems to be

Re: Summary of I/O related RFCs

2000-08-09 Thread Chaim Frenkel
> "JE" == Jon Ericson <[EMAIL PROTECTED]> writes: JE> =item 33 (v1): Eliminate bareword filehandles. (language) JE> No discussion. I think it carried unanimously. JE> =item 36 (v1): Structured Internal Representation of Filenames JE> (internal) JE> No discussion of the proposal that "Where

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 05:45:27PM +0100, Graham Barr wrote: > > open '/usr/local/bin/'; # directory (note the trailing '/') > > Portability, not all platforms use / But this one is. If this were a Mac open ':usr:local:bin:'; # note the trailing : would Do The Righ

Re: RFC 14 (v2) Modify open() to support FileObjects and

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 07:26:29PM +, Nick Ing-Simmons wrote: > Graham Barr <[EMAIL PROTECTED]> writes: > >On Wed, Aug 09, 2000 at 11:41:42AM -0500, Jonathan Scott Duff wrote: > >> How about this? > >> > >>open '/etc/passwd'; # file > > > >OK > > > >>open '/usr/local/bin/'

Re: Summary of I/O related RFCs

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 06:37:07PM -0700, Jon Ericson wrote: > =item 33 (v1): Eliminate bareword filehandles. (language) > > No discussion. Using "$fh = open()" accomplishes this. I think everyone is in agreement that bareword filehandles must go. > > =item 39 (v1): print operator > > No di