Basic HTML version of Foils prepared April 16,1996

Foil 38 Example of Method in class HTML::FormatPS

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


1 $self is of course pointer to datastructure and so following code will alter object passed in first argument
2 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
3 }

in Table To:


© 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