On Fri, Feb 06, 2009 at 08:30:01PM +0100, Thomas Rast wrote: > The code below _seems_ to work. I have to say that beyond the > 'require', it's all voodoo to me, so I'd appreciate an extra-careful > check. > [...] > +sub ReadMode; > +sub ReadKey; I believe it is fine. The tricky thing is that perl's parsing is dependent on what functions have been defined. So it is OK to say ReadKey 0; if a subroutine ReadKey has been defined, but otherwise it generates a warning about using the bareword as a function. However ReadKey(0); parses unambiguously, so it is always OK, even if no subroutine has yet been defined. So with the "use" code, Term::ReadKey had already been loaded when parsing the bit about ReadKey. But now it is loaded at run-time, so at parse time we don't know about that subroutine yet. So your options are to forward-declare the subroutines (which you did), or to change calls to the obvious function-like form. > - use Term::ReadKey; > + require Term::ReadKey; > + Term::ReadKey->import; And the two added lines are the exact runtime equivalent of the deleted line (note that you could also skip the import and just call Term::ReadKey::ReadKey by its full name). -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html