Perl won't eval PgSQL boolean value

From: Randall Perry <rgp(at)systame(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Perl won't eval PgSQL boolean value
Date: 2001-09-03 00:01:27
Message-ID: B7B84096.FCEF%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 help(at)systame(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tankgirl 2001-09-03 05:22:18 Adding a Foreign Key
Previous Message Jeff Davis 2001-09-02 11:20:09 Effect of Filesystem