This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid trying to load packages that are in the same file
authorGabor Szabo <szabgab@gmail.com>
Mon, 22 Jun 2009 19:42:57 +0000 (22:42 +0300)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 22 Jun 2009 21:03:51 +0000 (23:03 +0200)
(amended by rgs)

lib/Term/ReadLine.pm

index d251271..9681c11 100644 (file)
@@ -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;";
   }