return sort 

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

say $_ foreach all_authors(@books);
Wilbert Awdry
Jon Stephenson
Leo Tolstoy
Nicky Hager