Open yko opened 13 years ago
I think it is the same as for parsing xml. You always want to get an arrayref so you don't have to write something like:
my $objects = $article->create_related(%some_params_from_a_user);
if (ref $objects eq 'ARRAY') {
...
}
else {
...
}
Shouldn't return value depend on passed parameters? If single hashref passed to function, why should it return arrayref/array with single value? Wouldn't it be more organic if it returns single object if there was single hashref in parameters?