I've got an if statement that checks if a boolean value is true:

    if ($cust_data->{'hold'} eq 't')

But perl will not evaluate the value. $cust_data->{'hold'} is taken from a
PgSQL boolean field (either t or f). If I use the construct above it tell me
that 'eq' is not defined thinking it's a string.

If I use:
if ($cust_data->{'hold'} == 't')

I get an error saying $cust_data->{'hold'} is a non-numeric value.

If I do this:
 if ($cust_data->{'hold'})

it will always evaluate to true whether the value is 't' or 'f'.


HELP. How do you evaluate boolean values from PgSQL in Perl?


-- 
Randy Perry
sysTame
Mac Consulting/Sales

phn                 561.589.6449
mobile email        [EMAIL PROTECTED]




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to