This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RT #75468: readline ignores <> overloading when arg is tied
authorFather Chrysostomos <sprout@cpan.org>
Wed, 11 Aug 2010 11:51:25 +0000 (21:51 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 11 Aug 2010 11:51:25 +0000 (21:51 +1000)
pp_hot.c
t/op/tie.t

index d66ddde..2b67f4f 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -318,6 +318,7 @@ PP(pp_padsv)
 PP(pp_readline)
 {
     dVAR;
 PP(pp_readline)
 {
     dVAR;
+    dSP; SvGETMAGIC(TOPs);
     tryAMAGICunTARGET(iter, 0);
     PL_last_in_gv = MUTABLE_GV(*PL_stack_sp--);
     if (!isGV_with_GP(PL_last_in_gv)) {
     tryAMAGICunTARGET(iter, 0);
     PL_last_in_gv = MUTABLE_GV(*PL_stack_sp--);
     if (!isGV_with_GP(PL_last_in_gv)) {
index 5628694..6e52a6e 100644 (file)
@@ -847,7 +847,7 @@ fetching... <=> 1
   map {
    my $op = $_;
    $_ => sub { print "$op"; 100 }
   map {
    my $op = $_;
    $_ => sub { print "$op"; 100 }
-  } qw< 0+ "" + ** * / % - neg int abs == < > <= >= != <=> >
+  } qw< 0+ "" + ** * / % - neg int abs == < > <= >= != <=> <> >
 }
 $o = bless [], overloaded;
 
 }
 $o = bless [], overloaded;
 
@@ -872,6 +872,7 @@ $ghew=undef; $ghew<=1; print "\n";
 $ghew=undef; $ghew >=1; print "\n";
 $ghew=undef; $ghew != 1; print "\n";
 $ghew=undef; $ghew<=>1; print "\n";
 $ghew=undef; $ghew >=1; print "\n";
 $ghew=undef; $ghew != 1; print "\n";
 $ghew=undef; $ghew<=>1; print "\n";
+$ghew=undef; <$ghew>; print "\n";
 $ghew=\*shrext; *$ghew; print "\n";
 $ghew=\@spled; @$ghew; print "\n";
 $ghew=\%frit; %$ghew; print "\n";
 $ghew=\*shrext; *$ghew; print "\n";
 $ghew=\@spled; @$ghew; print "\n";
 $ghew=\%frit; %$ghew; print "\n";
@@ -893,6 +894,7 @@ fetching... <=
 fetching... >=
 fetching... !=
 fetching... <=>
 fetching... >=
 fetching... !=
 fetching... <=>
+fetching... <>
 fetching... *{}
 fetching... @{}
 fetching... %{}
 fetching... *{}
 fetching... @{}
 fetching... %{}