Basic HTML version of Foils prepared Sept 20 97

Foil 38 Example of Method in class HTML::FormatPS

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


$self is of course pointer to datastructure and so following code will alter object passed in first argument
sub papersize {
  • my($self, $val) = @_; # $self is reference to object
  • $val = "\u\L$val"; # Uppercase first, lowercase following letters in string $val
  • my($width, $height) = @{$PaperSizes{$val}};
  • return 0 unless defined $width;
  • $self->{papersize} = $val; # reset object attributes
  • $self->{paperwidth} = $width;
  • $self->{paperheight} = $height;
  • 1; # return 1 (or 0 if error) BUT not $self
}



© 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