>>>>> "JW" == Jun Wan <[EMAIL PROTECTED]> writes:

  JW> Is there a way to do the sementic checking on subtroutines? I want
  JW> to make sure the the subroutine called is defined somewhere
  JW> (either from an imported module, or system builtin). I know 'use
  JW> strict' can prevent you from using a variable before defining it,
  JW> so is there a way to do the similar thing to subroutines? without
  JW> having to run the script and watching it throw up. For

  JW> example, the following code passes 'perl -c' test:
  JW> -------
  JW> #!/usr/bin/perl -w
  JW> use strict;
  JW> use File::Find;
  JW> File::Find::non_exist_sub('a','b');
  JW> --------

well, if you solve the halting problem you could solve this too. :) perl
is so dynamic that the only way to know if a sub exists is to call it or
check the symbol table. 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. perl6 seems to be promising more than that.

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

Reply via email to