um unvorhersehbare Dinge durch wantarray zu vermeiden.
sub items_sorted {
my ($self) = @_;
- my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
- return wantarray ? @sorted : \@sorted;
+ return [ sort {$a->id <=> $b->id } @{ $self->items } ];
}
sub sales_order {
sub items_sorted {
my ($self) = @_;
- my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
- return wantarray ? @sorted : \@sorted;
+ return [ sort {$a->id <=> $b->id } @{ $self->items } ];
}
sub is_sales {
sub items_sorted {
my ($self) = @_;
- my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
- return wantarray ? @sorted : \@sorted;
+ return [ sort {$a->id <=> $b->id } @{ $self->items } ];
}
sub type {
sub items_sorted {
my ($self) = @_;
- my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
- return wantarray ? @sorted : \@sorted;
+ return [ sort {$a->id <=> $b->id } @{ $self->items } ];
}
sub is_sales {