It's a simple question. I've got a function that return a hash or undef if no value is found.
my %resp = my_func(); if(defined %resp) { #do something like print $resp{foo}; print{bar}; }
If the function return undef, I've got the warning "Odd number of elements in hash assignment".
That's makes sense, since the hash got only one value (undef). But I need to check if the hash has values, or the application will crash if I just assum there are values and try to use it...
In reply to return a hash or undef by odrevet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |