Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I know there are many other ways to check this, like checking against $array[0] eq "" (though not very good assuming $array[1] might have data. But why does @array eq "" not catch if it's null'd?my @array; if (@array eq "") { print "TEST1 passed\n"; } if (@array) { print "TEST2 passed\n"; } #### prints TEST2 passed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: differences between eq "" and !
by ikegami (Patriarch) on Dec 14, 2006 at 04:01 UTC | |
|
Re: differences between eq "" and !
by imp (Priest) on Dec 14, 2006 at 04:08 UTC | |
|
Re: differences between eq "" and !
by siva kumar (Pilgrim) on Dec 14, 2006 at 06:37 UTC | |
|
Re: differences between eq "" and !
by ww (Archbishop) on Dec 14, 2006 at 15:34 UTC | |
by TimToady (Parson) on Dec 14, 2006 at 17:14 UTC | |
|
Re: differences between eq "" and !
by ferreira (Chaplain) on Dec 19, 2006 at 19:36 UTC |