[EMAIL PROTECTED] wrote:
> Hi,
>
> What's the preferred waying of doing things...
>
> if ($var eq '')
>
> or
>
> if (defined $var)
>
> I assume they both mean pretty much the same thing?
>
No, defined is used to tell if the value is undef or not.
undef is a special scalar value, it is tr
Hi,
What's the preferred waying of doing things...
if ($var eq '')
or
if (defined $var)
I assume they both mean pretty much the same thing?
Tristan
You Wrote:
--
Hi Tanton,
Yes, but what I really want it to do is go though all the values of the
hash and if any of them contain nu
g" <[EMAIL PROTECTED]>
To: "Tanton Gibbs" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 2:55 AM
Subject: Re: Checking if a hash has blank values.
> Tanton,
>
> I must be so close! I just can't get it to print the key va
$hash{$hash_key} contains a null value!";
> }
> }
> - Original Message -
> From: "Daniel Falkenberg" <[EMAIL PROTECTED]>
> To: "Tanton Gibbs" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 10, 2002 2:36 A
$hash_key} eq "" ) {
print "\$hash{$hash_key} contains a null value!";
}
}
- Original Message -
From: "Daniel Falkenberg" <[EMAIL PROTECTED]>
To: "Tanton Gibbs" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 1
} eq "" and die "Empty hash!" foreach( keys %hash );
> - Original Message -
> From: "Eric Beaudoin" <[EMAIL PROTECTED]>
> To: "Daniel Falkenberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, April 10, 2002 2:22 AM
> S
D]>
Sent: Wednesday, April 10, 2002 2:22 AM
Subject: Re: Checking if a hash has blank values.
> At 02:08 2002.04.10, you wrote:
> >Hey all,
> >
> >I have created a hash that looks similar to the following...
> >
> >%hash (
> >'test1' =>
At 02:08 2002.04.10, you wrote:
>Hey all,
>
>I have created a hash that looks similar to the following...
>
>%hash (
>'test1' => $test1,
>'test2' => $test2,
>'test3' => $test3,
>);
>
>Now is it possible to have a little piece of code check the values of
>that hash and see i
Hey all,
I have created a hash that looks similar to the following...
%hash (
'test1' => $test1,
'test2' => $test2,
'test3' => $test3,
);
Now is it possible to have a little piece of code check the values of
that hash and see if their are any blank fields?
Something