On macOS, exiting the script requires 15 additional seconds. This is a great test case for comparing "my" vs "our".
my (%by_count, %by_word); # slow cleanup/exiting
$ time perl choroba.pl big1.txt big2.txt big3.txt >cpp.tmp
start
get properties: 21 secs
sort + output: 25 secs
total: 46 secs
real 1m2.072s
user 1m0.182s
sys 0m1.885s
our (%by_count, %by_word); # fast cleanup/exiting
$ time perl choroba.pl big1.txt big2.txt big3.txt >cpp.tmp
start
get properties: 21 secs
sort + output: 25 secs
total: 46 secs
real 0m47.062s
user 0m45.505s
sys 0m1.549s