diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-31 20:46:02 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-31 20:46:02 +0000 |
commit | 18708f5a7334d978ddf7562cb7f58e28bec6e4ed (patch) | |
tree | fd546b7856fc3ed473e57722637cfad50805da86 /scope.c | |
parent | 539a3d6c530ba5e4a9bb32654bf5f07b038a4434 (diff) | |
download | perl-18708f5a7334d978ddf7562cb7f58e28bec6e4ed.tar.gz |
make nested ARGV/$^I loops work correctly; fixes several bugs
in the way ARGV state was handled in readline(); writing a
subroutine to do inplace edits is now possible, provided *ARGV,
*ARGVOUT, $^I and $_ are localized where needed
p4raw-id: //depot/perl@4502
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -279,9 +279,14 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty) if (empty) { register GP *gp; + Newz(602, gp, 1, GP); + if (GvCVu(gv)) PL_sub_generation++; /* taking a method out of circulation */ - Newz(602, gp, 1, GP); + else if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) { + gp->gp_io = newIO(); + IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START; + } GvGP(gv) = gp_ref(gp); GvSV(gv) = NEWSV(72,0); GvLINE(gv) = PL_curcop->cop_line; |