Skip to content

Commit

Permalink
[PATCH] use of non-localised $_ in Net::LDAP::Constant causes prolems…
Browse files Browse the repository at this point in the history
… in lemonldap-ng

[perl-ldap 0.4001; perl 5.10.1]

Please find attached a patch that fixes a problem when requiring
Net::LDAP in certain environments. The problem can be demonstrated by
running:

perl -we'require Net::LDAP for (1,2)'

Similar code is used in lemonldap-ng's test suite since a long time,
and with perl-ldap 0.4001, tests suddenly fail. There is a bug report
in Debian about this at http://bugs.debian.org/577340

I hope the patch is OK and you would incorporate it in a future
perl-ldap release.
  • Loading branch information
real-dam authored and gbarr committed Jun 28, 2010
1 parent 7f07415 commit 3505b9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Net/LDAP/Constant.pm
Expand Up @@ -10,6 +10,7 @@ use Exporter qw(import);

my @err2name;

local $_;
while(<DATA>) {
last if /^=cut/;
my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/;
Expand Down
5 changes: 5 additions & 0 deletions t/06constant.t
@@ -1,4 +1,9 @@
#!perl -w

BEGIN {
for (1,2) { require Net::LDAP::Constant; }
}

use Net::LDAP::Util qw(ldap_error_name);;

my @constant = qw(
Expand Down

0 comments on commit 3505b9c

Please sign in to comment.