>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'
I do use them, occasionally...

>Already. These proposals just make that the default.
No the "default" is what people learn, and see in examples, convention,
recommended usage etc. This is making it the only way to do things.

>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.
Perl6 does not *have* to break anything, and certainly not everything.
The prime directive should be not to break things unless necessary.
Translation should not be a fall-back panacea. And it surely isn't perfect...

>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:
They are if they kill $/ etc.

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

Okay so what about doing this then:

[$return = ] open(bareword, string)
        acts as it currently does
$handleobj = open(string)
        which is one arg in scalar context acts as you propose.
Additionally perhaps one arg string type in list context returns the object,
and the result (so as to not force an or die in place).
($handleobj, $return) = open(string)

Internally bareword filehandles and $handleobj could even be of the same type.

>But *in addition* you have access to lots more power. It's there if you
>need it, but not if you don't.
Above everyone gets/retains their power

>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.
Yes, as a matter of fact I spent the afternoon reading all 120+ of them.

>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:
So perhaps then simply conceive of a way to allow handles to passed around...

print_out(\HANDLE, @data);

sub print_out {
        my $handleref = shift;
        #my $handle = _{$handleref};
#_ or some other char is coopted for dereferencing...
#or hey here's a novel idea, since we can ref to determine what type something
#is... how about a deref function to take a reference and return the value
#of the dereferenced reference? (Any thoughts on this? Should I RFC it?)
# $F = [1,2,3]; @F = deref($F);
#It kinda goes against all that highlander movement, AIIC
#This would not replace other methods of dereferencing in any way shape or
#form, HOWEVER, it might be the only way to dereference newer datatypes,
#or oddball things such as barewords?
}
>   print_out($HANDLE, @data);

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

>No more "local(*F)" and other ridiculously kludgey constructs.
Agreed, this is bad.

I will conceed one thing though, this is a bit more Perl-ish, in the
since that you are returning something of use, instead of the C-ish
"I'll modify the arguments you give me".
-- 
                                                  *             __    *      .
           \     |     /           .        . .           .  . ((_
               _____                       .                         .     .
          --  /     \  --           .        .      .   +    .   .     _/\
      oooooooooo.   |               * .       .   .           *       / ;M\_ .
   .oooooooooooo.oo.                  .  .    .       . /\    .      /  :IMM\
  ..oooooooooooo..oo.   Jerrad Pierce              /\  /  \         /   ;IIWMM
  ..oooooooooo.......   209 North Street     +    /  \ /  \  .     /   ;IIIIWM
  ...ooooooooo.......   Randolph, MA 02368        /  \     \  ___/   :;IIIIIWM
  ....ooo....o.......                            /    \    \ /  ::     ;;IIIMI
   .....ooo.........    http://www.pthbb.org     /    \     \   :     :::;IIIM
     ..ooooooo....      __________________________ ||   ||       ::.....::::::
MOTD on Prickle-Prickle, the 10th of Bureaucracy, in the YOLD 3166:

Too la roo la roo la roo la roooooooo!

Reply via email to