perl--- base module

 

base---Establish an ISA relationship with base calsses at compile time.

Example:

    package Baz;

    use base qw(Foo Bar);

    is same to :

    package Baz;

    BEGIN{

              require Foo;

                require Bar;

              push @ISA, qw(Foo Bar);

      }

base: allow you to both load one or more modules, while setting up inheritance from modules at the same time.

  base employs some heuristics to determine if a module has already been loaded, if it has it doesn't try again. If base tries to require the module it will not die if it cann't find the module's file, but will die on any other error. After all this, should your base calss be empty, containing no symbols, itwill die.

If a variable is not detected after loading it, base will define ith in the base package, setting it to null. Multiple inheritance of fields is not supported, if two or more base classes each ahve inheritable fields the base pragma will croak.

你可能感兴趣的:(Module,File,UP,inheritance)