Suppose module CGI.pm has a sub-routine named sub1 and i
"use CGI" in my perl code and create a sub-routine named sub1 not knowing that a sub-routine with the same name already exists in CGI.pm. now if i declare and define sub1 and call it in my program using this syntax:
sub1();
which one will it refer to (assuming that both sub-routines have the exact same prototype)? i don't need to fully qualify the function name with the package name as it is imported at compile time using the "use" keyword.
how do i stop this ambiguity from happening when i write a module and allow others to use my functions/subs and variables from my package?
Thanks in advance.
Gokul
In reply to Lexical and dynamic scope confusion! by GoCool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |