in reply to In place edit 5.005_03 vs 5.8.3

Does it work without the line local *ARGV;?

I remember a bug in an older perl where @ARGV, or is it the ARGV file handle, lost its magic when you localized the glob. But I don't remember if that was still so in 5.005.

Update: I've looked up the thread that I remember, as I was in it. It's here: Re: A buggy intersection-method. Look at the date: Jun 23, 1999.

Now look at the date of perl 5.005_03: Mar 28, 1999. That's just a few months earlier. So yes, that bug should still be in 5.005_03.

Replies are listed 'Best First'.
Re^2: In place edit 5.005_03 vs 5.8.3
by jzb (Hermit) on Apr 28, 2006 at 21:00 UTC
    Yes, but it breaks the flow if there is another variable. See here:
    sub change_me{ $myvar = somesub(); local $^I = ".bak"; @ARGV = "some_file"; while (<>) { s/foo/$myvar/i; print; } }
    This code hangs. I just can't wrap my head around what happens to $myvar. If this is a static entry (like above) it completes.
      Is there a way to get 5.005_03 to use the variable and not hang?