in reply to Confused Still by Hash Refs
if you are calling it with this:my($userdb,%group) = @_;
&GroupCreate($userdb,\%group);
You are sending the sub a scalar (I assume) and a hashref, but the assignment
is trying to assign a hash, not a hashref, and therefore expecting the parameters after $userdb to be a list (i.e. the contents of the hash itself). As an alternative, try:my($userdb,%group) = @_;
my ($userdb,$groupref) = @_; my %group = %$groupref;
my ($userdb,$group) = @_;
FWIW, thats what:
[Thu Feb 2 22:29:32 2006] test-auth5.cgi: Odd number of elements in h +ash assignment at /var/wwwssl/auth-test/test-auth5.cgi line 379.
is telling you.
Update: all the uses of %group in the sub appear to be addressing a hashref $group, with the exception of the assignment, so there's no need to dereference it at all.
--------------------------------------------------------------
"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Confused Still by Hash Refs
by hesco (Deacon) on Feb 03, 2006 at 12:22 UTC | |
by g0n (Priest) on Feb 03, 2006 at 12:33 UTC |