This does the same thing?
#! perl -slw use strict; sub test { my $x = shift; my $y = shift; my $z = shift; print $x + $y + $z; } sub apply2 { my( $code, $argsRef ) = @_; return $code->( @$argsRef ); } apply2( \&test, [1,2,3] );
In reply to Re: Applying an array to a function
by BrowserUk
in thread Applying an array to a function
by eklerks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |