in reply to How do I pass hash in subroutine with multiple parameters

Here is an alternative way of faking named parameters. This uses a hash inside the subroutine (%params):
use strict; use warnings; my %modHash = qw (Ford Mundaneo Honda Civet Rolls Rice); my $pdtName = 'Fred Bloggs'; getHash(pdtName => $pdtName, modHash => \%modHash); sub getHash{ my %params = @_; my $pdtName= $params{pdtName}; my $moduleHashref= $params{modHash}; while (my ($key, $value) = each(%$moduleHashref)){ print "key: $key, Value: $value\n"; } }