[Chicago-talk] Arguments

Steven Lembark lembark at wrkhors.com
Sun Jan 18 23:31:38 CST 2004

-- "Randal L. Schwartz" <merlyn at stonehenge.com>

> Don't use prototypes!

An example of why:

Pod shows an example of:

	 Parallel::Pvm::spawn( 'client', 4 );


	Parallel::Pvm::spawn( 'client', $count, SomeSetting, 4 );

ok, I try:

	my @argz = ( "$Bin/client", 1, @_ );

	Parallel::Pvm::spawn( @argz );

This fails because it needs at least two arguments. Except that
it HAS two arguments. Except that the prototype was written as
something like "$, $, @". No now instead of just passing a list
of arguments I get something like:

	my @argz = whatever...

	Parallel::Pvm::spawn( $argz[0], $argz[1], @argz[2..$#argz] );

This may seem enticing to Java or Python hackers but
certianly does not seem like anything I'd want to find
in Perl code I'm maintaining...

Stripping the use prototypes from the .xv file and .pm's has
cleaned things up on the perly side -- now I'm checking whether
it causes any errors for the internals or if I need some perl
wrappers for finicky xs calls.

Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 888 359 3508

More information about the Chicago-talk mailing list