in reply to When C<use Module;> *not* the same as C<require Module; import Module;>?
For example, take:
If foo is already known by the perl parser to be a subroutine, it will interpret this as meaning:print foo;
However, if the interpreter does not know that foo is supposed to be a subroutine, then it will interpret foo to be the name of a file-handle (the indirect argument to print). This is all happening at compile-time (well, parse-time, really... but parse and compile happen together), so it doesn't matter whether or not foo is a subroutine at runtime... because the parser will have already decided that it was being used as the name of a filehandle, at runtime.print(foo());
------------ :Wq Not an editor command: Wq
|
|---|