Basic HTML version of Foils prepared April 16,1996

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

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


There is a well known problem with ordinary ways of using Perl subroutine arguments
If one has a argument list which is
(@list1, @list2, .... ), then subroutine only sees a single list (array) concatenating the component lists
This can be avoided using hard references with \ operator and shown by 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 Sat Sep 6 1997