Re: Can overloaded '+' return an array? If so, how?



jl_post@xxxxxxxxxxx wrote:
I fiddled around with your test code, and I found that, while the
code:

my @ar = $ca1 + ca2;

is not called in list context, the following three functionally
equivalent lines:

my @ar = $ca1->combine($ca2);
my @ar = combine $ca1 $ca2;
my @ar = ClassAct::combine($ca1, $ca2);

do return an array as you want -- without the need to change the
combine() method.

I do find that both interesting and useful.

Thanks,
-P.

.