> I vehemently disagree with this filehandle object nonsense.
> This is Perl, not Java, not Python. Everyone together Purrl... :-P

Well, fileobjects are already in Perl 5. Most people just don't use them
by default. But as TomC pointed out, in Perl 5 you can do this:

   open $fh, "$file";    # if 'use FileHandle'

Already. These proposals just make that the default.

> Okay so why do I disagree?
>         a) It breaks old stuff. This is always bad

Not if it makes stuff better! Like it or not, Perl 6 is going to break a
*lot* of stuff. But we'll have translator scripts to fix most of it.
Restructuring the filehandle and IO system has been on everybody's
wishlist for a long time. We finally have the chance to fix it.

>    b) It forces your notions of programming methodologies upon others.
>       I don't like OO. It's good for data, but that's it IMHO.
>        If you want OO files, use some IO packages...

I think you're missing a key point here. Nobody is forcing OO on
anybody! At all! The simple usage of open and files will still exist:

   $FILE = open "<$file" or die $!;
   print $FILE "$stuff";
   close $FILE;

But *in addition* you have access to lots more power. It's there if you
need it, but not if you don't.

That's why I explicitly *did not* say "$| must go away". This is a
separate discussion. It may well stay. I agree with you completely: OO
should be there if you need it, but NOT thrust on you.

>     c) You're not fixing a problem (if it ain't broke don't fix it).
>        And if you insist on fixing it, you'd damn well make it better.
>        So far this is all a one to one exchange. (see part a)

I can't see how you could possibly draw that conclusion. Are sure you
read the RFC's? Not trying to be mean, but there are some major
improvements that most everyone on -io agrees are very beneficial.
Nobody on this list is just changing filehandles for the heck of it.

>         d) I like filehandles as barewords

Again, don't take this the wrong way, but I think the bareword
filehandles issue is pretty much a dead horse. You're the only one I've
heard who's opposed to the idea. Most everyone else is very enthusiastic
about it, especially since it moves filehandles into first-class
variables.

I do agree it makes them stand out less. However, if you make them all
uppercase still, then the only difference is $. And you get many more
improvements. For example, to pass a filehandle around in Perl 5, you
have to do complex globbing. In Perl 6, this becomes simple assignment:

   print_out($HANDLE, @data);

   sub print_out {
      my $handle = shift;
      print $handle @_;
   }

No more "local(*F)" and other ridiculously kludgey constructs.

I hope others will back me up a little. :-) Just because my name's on a
lot of the -io RFC's doesn't mean I'm the only one who feels this way.
Lots of other people on this list are extremely helpful and very
enthusiastic to fix filehandles in Perl 6.

-Nate

Reply via email to