in reply to parse hash to sub
In reference to your question, either pass a reference or shift off the first item, then assign to your hash - ie:
my $count = shift; %packages = @_; [download]
HTH...