in reply to Is this "next unless $keys" necessary?
It is necessary if an empty key i.e. '', is legal & expected, but no processing is to be done for it i.e. it has to be avoided when processing all keys.
It's not too dissimilar to:
foreach $key (sort grep $_, keys %{$obj->somehash}) { . . .
Update:
Updated to reflect the actual logic - original only tested for empty string ... c/w true/false test as pointed out elsewhere by Fletch.
A user level that continues to overstate my experience :-))
|
---|
In Section
Seekers of Perl Wisdom