in reply to More on: memory usage/leaks

That by itself should be fine. I would, however, write the above snippet as something more like:
my $tmp_log = ($Output{host} ||= []); push @$tmp_log, $data; if (10 < @$tmp_log) { shift @$tmp_log; }
However I have to wonder at your data structure. Do you have multiple hosts here and so mean $Output{$host}? Or is %Output full of different kinds of logs, and so you could factor out common code that manipulates each one? Similarly the variable $data seems rather uninformatively named. Most things in a program are data of one kind or another. What kind of data is this data? I would suggest a different structure, but from the snippet you provide I don't have enough to make a concrete suggestion. PS The ||= line I had may confuse. Depending on the skill level of your maintainers, you might be better off expanding that out into:
unless (exists $Output{host}) { $Output{host} = []; } my $tmp_log = $Output{host};