Subject: | [Patch] Inject method removes modules from modulelist which it shouldn't |
Hi,
I discovered a small bug in the inject method where it removes too much when trying to remove
"old" entries on the module list.
Eg. If You first inject Any::Moose and then Moose the inject method will remove Any::Moose
from the modulelist.
The attached patch fixes the issue.
--
Best regards,
David Jack Olrik <david@olrik.dk> http://david.olrik.dk
GnuPG fingerprint C290 0A4A 0CCC CBA8 2B37 E18D 01D2 F6EF 2E61 9894
["The first rule of Perl club is You do not talk about Perl club"]
Subject: | CPAN-Mini-Inject-0.27.patch |
diff -NurB CPAN-Mini-Inject-0.27.orig/lib/CPAN/Mini/Inject.pm CPAN-Mini-Inject-0.27/lib/CPAN/Mini/Inject.pm
--- CPAN-Mini-Inject-0.27.orig/lib/CPAN/Mini/Inject.pm 2010-01-28 21:11:23.000000000 +0100
+++ CPAN-Mini-Inject-0.27/lib/CPAN/Mini/Inject.pm 2010-11-26 11:54:51.000000000 +0100
@@ -310,7 +310,7 @@
# remove old version from the list
@{ $self->{modulelist} }
- = grep { $_ !~ m/$options{module}\s+/ } @{ $self->{modulelist} };
+ = grep { $_ !~ m/^$options{module}\s+/ } @{ $self->{modulelist} };
push(
@{ $self->{modulelist} },