[comp.lang.perl] simple debugger help wanted

thompson@hplabsz.HPL.HP.COM (Brent Thompson) (09/19/90)

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?
-- 
Brent Thompson
HP Labs, 1501 Page Mill Road, Bldg. 1U, Palo Alto, CA 94304

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (09/19/90)

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