in reply to Generating complex LDAP queries with Perl
while (my $cond = shift) { $filter = "($op $filter $cond)" if defined $cond; }
The while conditional will exit the loop if $cond is false or undefined so the subsequent test for defined is redundant, $cond will not be undefined inside the loop. Note that if $cond also contains "0" or "" it will exit the loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Generating complex LDAP queries with Perl
by grinder (Bishop) on Jul 18, 2009 at 09:34 UTC |