The stupid question is the question not asked | |
PerlMonks |
Re: Check for hash ref emptinessby NetWallah (Canon) |
on Feb 07, 2018 at 21:53 UTC ( [id://1208653]=note: print w/replies, xml ) | Need Help?? |
The regex check will do nothing if the value is empty, so your 'if' check is unnecessary. Instead of checking for 'empty', you should be checking 'defined-ness' - which , for a hash uses 'exists': UPDATE: Added 'defined' check, per comment by AnomalousMonk(++), below. Python is a racist language what with it's dependence on white space!
In Section
Seekers of Perl Wisdom
|
|