Basic HTML version of Foils prepared April 16,1996

Foil 32 Perl5 Object Model -- II

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 Material -- April 16,1996. by Geoffrey C. Fox


Objects are further:
  • objects are created by a "constructor" which is any suitable function in given module but CONVENTION says for one to call this constructor new
  • so new is (arbitary) name for a subroutine and not a language construct
A class method is a conventional Perl5 subroutine defined in given class (package) which expects its first argument to be either an object reference or for static methods (independent of object instance) the class name
The class name IS the package name



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Sep 6 1997