Overriding readline

rafael on 2002-01-15T20:44:03

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.