Basic HTML version of Foils prepared April 16,1996

Foil 6 Perl Modules -- Packages - I

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


package fred
$var = 3.14159; # defines fred to be a package and var to be a variable in this package so that variables following this statement should be accessed by
$globalaccess = $fred::var;
Packages can be nested
package fred
....................
package jim
$var = 3.14159; # and now we use syntax
$globalaccess = $fred::jim::var;



© 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