$ perl -MData::Dumper -e'print Dumper sub{return 1 if $_[0]}->(undef)' $VAR1 = undef; $ perl -MData::Dumper -e'print Dumper sub{return 1 if $_[0]}->(0 )' $VAR1 = 0; $ perl -MData::Dumper -e'print Dumper sub{return 1 if $_[0]}->("0" )' $VAR1 = '0'; $ perl -MData::Dumper -e'print Dumper sub{return 1 if $_[0]}->("" )' $VAR1 = '';
Update: Switched to DD to show the difference between string zero and numerical zero.
In reply to Re^3: return if 0
by ikegami
in thread return if 0
by zigdon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |