Basic HTML version of Foils prepared Sept 20 97

Foil 33 Constructor for class HTML::FormatPS - I

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


$formatter = new(HTML::FormatPS , FontFamily => 'Helvetica', PaperSize => 'Letter'); # create instance of class given in first argument with following arguments overriding default paramters
$formatter holds a reference to a blessed hash
remember => is just a comma and arguments to a Perl subroutine are just a single list -- here of 5 entities
In package HTML::FormatPS subroutine new looks like this (continued on next foil)
sub new {
  • my $class = shift; # set $class as package name and remove from argument list using shift function which takes @_ as default argument in subroutine



© 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 Sun Apr 5 1998