| Sorry for the dot-confusion, i replaced it with "->". As I said, it may be documented and known in the perl community, in my option it's still horrible. But yes, that's just my opinion of course. > Perl is not the only language to support this kind of feature; it is present in Ruby with the "splat" operator (*array). Unfortunately I also don't know ruby, but as far as i understand from what you're saying is that in ruby you need to explicitly tell ruby to "splat" the list in. I really have problems coming up with usecases for this kind of behaviour, but yes, sure under some curcumstances it might be nice. But i'd argue it's the minority and so having to explicitly "whitelist" it would make sense. To avoid exactly this problem, of accidentaly calling a function that might return a list.
The problem that I also see is that at some point you could refactor a function that previously couldn't return a list. Except maybe that's actually a thing in perl, to use this behaviour as a feature, I don't know. |
Yes, that's common. List processing via variadic arity functions is an explicit feature of Perl.