in reply to NULL Variables

dwalsh27,
Depending on what you mean - any one of the following might be what you want:
my $var; # undefined $var = undef; # explicitly set to undefined undef $var; # explicitly set to undefined $var = ''; # defined, but empty - will test false $var = 0; # defined with a value - which will test false $var = \0; # defined with a value of null
Cheers - L~R

Replies are listed 'Best First'.
Re: Re: NULL Variables
by dwalsh27 (Initiate) on Feb 04, 2004 at 19:34 UTC
    Thanks undef works. Isn't that the same as null??
      dwalsh27,
      No, undefined is not the same as being set to \0. That's why I said it depends on what you are trying to do with it. Unlike C, Perl strings are not null terminated. Maybe you are interested in knowing what is truth.

      Cheers - L~R