On Thursday, October 2, 2003, at 04:25 PM, [EMAIL PROTECTED] wrote:

I wan to write a sub return true or false if the var was initialized.

We can do that, but I really don't think we need a sub for it, since there is a built-in.


Can someone correct this sub or is it good?

No, I wouldn't call it good.


 ...
 if(isNULL($x) { print "it is null\n");

if ( ! defined $x ) { ... }


 else          { print "it is NOT null\n");
 ...

sub isNULL
{
  return $_[0] =~ //

This Regex doesn't do what you think. It reuses the last successful match.


You don't want a Regex here anyway, you meant:

$_[0] eq '';

Since I could set a variable to the empty string though, that doesn't really answer your question.

Hope that helps.

James

}

thanks,
-rkl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to