On Tue, Nov 09, 2004 at 11:40:30AM -0600, Joseph Paish wrote: > BTW, i think i may have found out what is giving me the strange line numbers > in the debugger under emacs. it seems that when i enter "p $." at the > debugger prompt, it displays whatever line number the debugger just printed > out. for example, if i have 17 debugger prompts before i issue the "p $." > command, it will display 17 instead of the line number of the file i am > reading at the time (which should be 1 if i just started reading the file). > > ok, now this is getting strange. i inserted some print statements in my > large script, and they showed that in fact, i had been entering the first > if() structure all along. the debugger was showing me bypassing it and going > straight to the second one. maybe based on the bogus $. values that the > debugger thought were accurate? (see previous paragraph) > > anyway, except for the debugger not working properly under emacs, i guess > there is no problem with the "if ($. == 1) structure . unfortunately, i have > grown to depend on the debugger to help me spot logic errors in my code. i > guess i am going to have to go back to simple print statements or run it from > the commandline where i *just* found out that it gives me the correct output.
You don't tell us which version of perl you are running, which is always helpful in situations such as this, but my guess is that it is ancient. There was a bug in perl5.6.0 and earlier versions of perl which would cause this behaviour. The bug was fixed by this patch, over four years ago: http://public.activestate.com/cgi-bin/perlbrowse?patch=6023 If I am correct, and you are running 5.6.0 or earlier, I suggest you upgrade in order to fix this problem and many others you might encounter. The latest maintenance release is 5.8.5 - I recommend it. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>