joec_ has asked for the wisdom of the Perl Monks concerning the following question:
this is probably really simple.
I am returning a numeric value from a database and want to trap it if it is null. So what i do at the moment is:
if ($id eq undef){
###deal with id
}else{
###deal with not undef id
}
What that does, works however it keeps throwing 'Use of uninitialised values in string eq' warnings, and i would like to be able to get rid of them, using an undef safe idea.
Any ideas?
Thanks -- Joe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: String equality and undef
by JavaFan (Canon) on Dec 09, 2008 at 12:56 UTC | |
|
Re: String equality and undef
by ccn (Vicar) on Dec 09, 2008 at 12:18 UTC | |
by Anonymous Monk on Dec 09, 2008 at 12:25 UTC | |
by mje (Curate) on Dec 09, 2008 at 13:25 UTC | |
|
Re: String equality and undef
by webfiend (Vicar) on Dec 09, 2008 at 14:28 UTC | |
by kyle (Abbot) on Dec 09, 2008 at 15:42 UTC | |
by webfiend (Vicar) on Dec 09, 2008 at 16:36 UTC |