in reply to Re: setting values in anonymous hash
in thread setting values in anonymous hash
I had left the variable reset in by mistake!
PS: works a treat though this way....
while (my ($k, $v) = each %$ref2) { $ref2->{$k} = '' if (!defined $ref2->{$k}); } push @{ $tablist{$user_table} }, $ref2;
Cheers..
PPS: and even better this way, thanks!!!!
for (keys %$ref2) { $ref2->{$_} = '' if (!defined $ref2->{$_}); } push @{ $tablist{$user_table} }, $ref2;
PPPS: maybe down to one line if I was using 5.5! (untested this last one)
$ref2->{$_} = '' unless (defined $ref2->{$_}) for (keys %$ref2);
|
|---|