in reply to Re: (tye)Re: line no. in a file
in thread line no. in a file
If I understand what is going on, then what we want to do is localize the "last file handle read" as well as $., but Perl gives us no access to localize the "last file handle read".
So I think lemming's patch is okay. It seems to me that what it does is temporarilly set $. for the wrong file handle to the "right" (expected by the user) value (and the user can't tell that the line number is being reported for the wrong file, just that the "right" line number is now being reported). This is why both the @saved and local bits are required. One puts the expected value into place while the other restores the correct value for the file handle that the user isn't interested in (but that the debugger is).
Well, I hope I got that right. I didn't dig into it so my analysis could be wrong.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re2: line no. in a file
by lemming (Priest) on Dec 29, 2000 at 21:05 UTC |