in reply to Re: Check Variables for NULL
in thread Check Variables for NULL
Note that compare strings with eq and ne instead of == and != since == and != coerce their arguments to numbers.# let's say you've got the user input in $input.. if (defined($input) && $input ne "") { # input is defined and not empty } else { print "input wasn't filled in\n"; }
See equality operators and defined in the documentation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Check Variables for NULL
by Trihedralguy (Pilgrim) on Feb 07, 2007 at 21:45 UTC | |
by greatshots (Pilgrim) on Feb 08, 2007 at 02:39 UTC | |
by PreferredUserName (Pilgrim) on Feb 08, 2007 at 14:57 UTC | |
by EvanK (Chaplain) on Feb 08, 2007 at 16:18 UTC |