[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a lookup of "" where the difference matters
From: |
Marcus Brinkmann |
Subject: |
a lookup of "" where the difference matters |
Date: |
Sun, 26 Aug 2001 03:04:44 +0200 |
User-agent: |
Mutt/1.3.18i |
Hi,
Roland already put the change in glibc that makes lookup on "" fail.
Here is an actual example where it is used:
if (! -d $ENV{POSTGRES_LIB} || ! -d $ENV{POSTGRES_INCLUDE})
{
...
}
This is perl code in the postgresql build. It expects the condition to
be true if either environment variable is not set (or is not a directory).
The code relies on the implicit conversion of undefined scalars to "".
It's not exactly clean, but common in the perl world, to make use of that.
Just for your information,
Marcus
- a lookup of "" where the difference matters,
Marcus Brinkmann <=