Basic HTML version of Foils prepared Sept 20 97

Foil 24 Some Remarks about Subroutines - 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


Subroutines must typically be predefined (with new sub command) if they are to be accessed with
subname(list); # or one can use
&subname(); # as equivalent to subname()
so that & notation is typically unnecessary
use packagename qw( NAME1 NAME2 NAME3); # imports routines NAME1 NAME2 NAME3 from package packagename
Notice qw() is new Perl5 routine to generate quotes around space separated words
  • qw(args); equivalent to split(' ', q(args));



© 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