Toddy Prawiraharjo wrote:
>
> In many occasions, I got NULL value inside my result, and I want to kick
> them off the @state list.
> What I have to do??
>
> I tried before:
> unless ($states != " ") {push (@state, $states);
As perldata.pod states, ``There are actually two varieties of null
strings (sometimes referred to as ``empty'' strings), a defined one and
an undefined one.''
Therefore, you need to test for *both*
$states != ""
***AND***
defined $states
Perhaps, somethinig like this?
if ($states != "" && defined $states)
{push (@state, $states)}
Unfortunately,
$states != " "
tests for a blank space, or some such; which is *not* null . . .
Hope that this helps . . .
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely proportional to how much we
think we know. The more I know, the more I know I don't know . . . "
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl