From aeeb13907a575905ecbff42fc030f66088fa79b1 Mon Sep 17 00:00:00 2001 From: Gabor Szabo <szabgab@gmail.com> Date: Mon, 22 Jun 2009 22:42:57 +0300 Subject: avoid trying to load packages that are in the same file (amended by rgs) --- lib/Term/ReadLine.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Term') diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm index d251271056..9681c117ca 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;"; } -- cgit v1.2.1