P
Peng Yu
Hi,
I use the following command to OR the values in an array. I'm
wondering what is the best way to do so. A function similar to
'accumulate' in mit-scheme or C++, may be helpful. But I don't find it
in perl.
my @array=(0,0,1);
my $result=0;
map { $result = $result || $_} @array;
print $result, "\n";
Regards,
Peng
I use the following command to OR the values in an array. I'm
wondering what is the best way to do so. A function similar to
'accumulate' in mit-scheme or C++, may be helpful. But I don't find it
in perl.
my @array=(0,0,1);
my $result=0;
map { $result = $result || $_} @array;
print $result, "\n";
Regards,
Peng