in reply to hash as subroutine argument

sub is used to declare functions, not call them. Read perlintro, perlsub.