in reply to How can I differentiate between 0 and whitespace in Perl?
use feature ":5.10"; $val=" "; given($val) { when (" ") { print "space"} when (0) { print "zero"} default { print "other" } }
print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I differentiate between 0 and whitespace in Perl?
by almut (Canon) on Apr 19, 2009 at 11:40 UTC | |
by codeacrobat (Chaplain) on Apr 19, 2009 at 14:40 UTC | |
by Anonymous Monk on Apr 19, 2009 at 12:43 UTC | |
by almut (Canon) on Apr 19, 2009 at 13:02 UTC |