Your problem in in this line:
my (%hash, $conf) = @_;List assignment is greedy. So the hash takes all of @_ leaving nothing to go into $conf. If you had "use warnings" turned on then you'd get the error about using a list with an odd number of elements to create a hash.
There are (at least) three solutions:
1. Pass the parameters the other way round.
my ($conf, %hash) = @_;2. Use "pop" to get $conf.
my $conf = pop @_; my $hash = @_;
3. Pass in a hash reference instead of the hash.
my ($hash_ref, $conf) = @_;See the Copyright notice on my home node.
"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg
In reply to Re: Passing hash and hashref to sub
by davorg
in thread Passing hash and hashref to sub
by ewhitt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |