Basic HTML version of Foils prepared Sept 20 97

Foil 28 Some Remarks about Subroutines - V -- Separating Arguments

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


There is a well-known problem with ordinary ways of using Perl subroutine arguments
If one has a argument list such as
(@list1, @list2, .... ), then the subroutine sees a single list (array), which is the concatenation of the component lists
This can be avoided using hard references with the \ operator. For example:
@tailings = popmany( \@a, \@b, \@c, \@d );
See next foil for code of popmany



© 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