[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Filehandles? IO::Handles?



On Sat, Jul 17, 1999 at 09:52:43PM -0400, Michael G Schwern wrote:
> My co-worker has this tendency to dig up and use every single obscure
> feature of Perl.  He showed me this one the other day, for those of
> you who are -really- into the whole OO thing:
> 
> use IO::Handle;
> 
> open(FILE, "whatever");
> while($line = *FILE->getline) {
> 	*STDOUT->print($line);
> }
> *STDOUT->print("This is just plain wrong.\n");
> 
> 
> Some sort of weird backwards compatibility thing <shudder>.
> 


So, would this be even more wrong?


use IO::Handle;

open(FILE, "whatever");
while($line = FILE->getline) {
    STDOUT->print($line);
}
STDOUT->print("This is just plain wrong.\n");


Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe