From: Gabor Szabo Date: Mon, 22 Jun 2009 19:42:57 +0000 (+0300) Subject: avoid trying to load packages that are in the same file X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aeeb13907a575905ecbff42fc030f66088fa79b1;p=p5sagit%2Fp5-mst-13.2.git avoid trying to load packages that are in the same file (amended by rgs) --- diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm index d251271..9681c11 100644 --- a/lib/Term/ReadLine.pm +++ b/lib/Term/ReadLine.pm @@ -303,7 +303,7 @@ sub get_line { package Term::ReadLine; # So late to allow the above code be defined? -our $VERSION = '1.03'; +our $VERSION = '1.04'; my ($which) = exists $ENV{PERL_RL} ? split /\s+/, $ENV{PERL_RL} : undef; if ($which) { @@ -311,6 +311,9 @@ if ($which) { eval "use Term::ReadLine::Gnu;"; } elsif ($which =~ /\bperl\b/i) { eval "use Term::ReadLine::Perl;"; + } elsif ($which =~ /^(Stub|TermCap|Tk)$/) { + # it is already in memory to avoid false exception as seen in: + # PERL_RL=Stub perl -e'$SIG{__DIE__} = sub { print @_ }; require Term::ReadLine' } else { eval "use Term::ReadLine::$which;"; }