Permalink
Browse files

[PATCH] use of non-localised $_ in Net::LDAP::Constant causes prolems…

… 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...
1 parent 7f07415 commit 3505b9c29a0e83d0f04e9211f4c57c36d76c1eac @real-dam real-dam committed with gbarr Apr 19, 2010
Showing with 6 additions and 0 deletions.
  1. +1 −0 lib/Net/LDAP/Constant.pm
  2. +5 −0 t/06constant.t
@@ -10,6 +10,7 @@ use Exporter qw(import);
my @err2name;
+local $_;
while(<DATA>) {
last if /^=cut/;
my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/;
View
@@ -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(

0 comments on commit 3505b9c

Please sign in to comment.