return sort 

sub all_authors {
    my %authors;
    foreach my $book (@_) {
        $authors{$_}++ foreach $book->authors;
    }
    return sort keys %authors;
}

say "Total unique authors: " . all_authors(@books);
Use of uninitialized value in concatenation (.) or string
at ./return-sort.pl line 82.
Total unique authors: