Good afternoon everyone,
I am trying to pass a hash of parameters to a subroutine and I get the
error
<error>
Odd number of elements in anonymous hash at ./test.pl line 5.
Odd number of elements in anonymous hash at ./test.pl line 5.
-title,HASH(0x8160d38),-author,HASH(0x8160eb8)
</error>
the code of the test script is:
<code>
#!/usr/bin/perl
use strict;
use warnings;
&test('-title'=>{'thetitle'}, '-author'=>{'name'});
sub test {
print join(',',@_), "n"
}
</code>
I am passing however even number of parameters! cause if I am not
mistaken => is consider as a comma.
What is the proper way to do this?
Regards,
cgavos