>>>>> "KS" == Kripa Sundar <[EMAIL PROTECTED]> writes:
KS> Dear Uri, >> [...] subs can come into existance any time and be >> handled by AUTOLOAD and such. so there is no easy compile time way to >> check that at the moment. [...] KS> It is the same principle as for any other stricture. The user is KS> asking perl to flag some *legal* usage as being unacceptable for KS> her/his purpose. but perl can't divine if subs exist before they are called because some module may do things differently. just look at AUTOLOAD. KS> For the user who does not want dynamically defined routines, it KS> should be trivial for the compiler to honour a suitable pragma KS> (say, "use strict sub_definitions") and die if it sees that there KS> are some subroutine invocations without any compile-time KS> definitions. but will that honor modules that are used? that pragma can be lexically scoped but it still is an issue. what about calling something in BEGIN but before it is compiled? perl can't detect that until it tries because something else in the BEGIN block could define the function. KS> An invocation before a declaration is legal Perl, but gets flagged KS> under "use strict subs". An invocation without a definition should be KS> equally easy to flag (although, of course, perl would have to wait KS> until the end of compilation to do so). if you invoke with foo() then you don't get that strict problem. the issue is how can you tell a sub will be defined when a call to it is compiled. if you call subs later in the source file, they won't be defined at the time of the call being compiled, so that fails. you can then force predeclaring of subs in that case (like c) but most perl hackers will hate that. i know what you want but i don't see any easy way to do it that will satisfy most people. uri -- Uri Guttman ------ [EMAIL PROTECTED] -------- http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

