Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of rafael (2125)

Tuesday January 15, 2002
03:44 PM

Overriding readline

[ #2154 ]
You may or may not be aware that the angle-bracket operator <FILEHANDLE> has an exact equivalent as a function : readline . This function is overridable, but, as of perl 5.6.1, this doesn't override the operator. I just submitted a patch to allow this in bleadperl. (The idea came from a discussion in c.l.p.moderated. It's cool to have usenet access again.)

Note that there are other ways to override <> if you want. There's the overload pragma (to be used with blessed objects) and tied filehandles. Moreover, if you override glob(), the glob operator (<*.c>) is also overriden.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.