Although if the XS compiles and loads, this code is not used.use vars qw($a $b); sub reduce (&@) { my $code = shift; return shift unless @_ > 1; my $caller = caller; local(*{$caller."::a"}) = \my $a; local(*{$caller."::b"}) = \my $b; $a = shift; foreach (@_) { $b = $_; $a = &{$code}(); } $a; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: Re (tilly) 2: List-to-Scalar Function?
by merlyn
in thread List-to-Scalar Function?
by Masem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |