Path: utzoo!attcan!uunet!lll-winken!sun-barr!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: simple debugger help wanted Message-ID: <9567@jpl-devvax.JPL.NASA.GOV> Date: 19 Sep 90 16:37:06 GMT References: <5946@hplabsz.HPL.HP.COM> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 27 In article <5946@hplabsz.HPL.HP.COM> thompson@hplabs.hpl.hp.com (Brent Thompson) writes: : I can't get the debugger (pl18, if that matters) to behave nicely. : : I am just trying to verify that my arrays are setup as expected, but $[ : is set differently for the executing script from what I see in the : debugger and this is error-provoking and aggravating. : : Very near the beginning my perl script does : $[ = 1; # a holdover from the days of awk : : But when I run the thing as 'perl -d', every time I ask what is $[, it is 0. : Imbedded 'print $[;' always shows 1, as expected. If I manually set $[=1, : everything is ok until the next record, when $[ has reverted back to 0 (of : course this is only the one I see from the debugger, not the one the script : is working with). : : What's happening? The debugger localizes variables like $[ so it can set them up the way it likes. Unfortunately, when it does an eval to print out the value you want, it's still in the (dynamic) scope of the debugging routine. The debugger ought to localize the values of those variables back to what you expect inside the eval. or translate references to them to refer to the saved location instead. It will be fixed, one way or another. Larry