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


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

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