You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "ugly hack" in Inline.pm is impacting the debugging of scripts (the INIT block is being intercepted by the Perl debugger). Here is the problematic code:
196 #==============================================================================
197 # Process delayed objects that don't have source code yet.
198 #==============================================================================
199 # This code is an ugly hack because of the fact that you can't use an
200 # INIT block at "run-time proper". So we kill the warning and tell users
201 # to use an Inline->init() call if they run into problems. (rare)
202
203 eval <<END;
204 no warnings;
205 \$INIT = \$INIT; # Needed by Sarathy's patch.
206 sub INIT {
207 \$INIT++;
208 &init;
209 }
210 END
When the Perl debugger launches for a script which uses Inline or a module which uses Inline, the debugger will start at line 206 of Inline instead of the first executable statement of the script. Hence, the INIT block in Inline.pm forces the script writer to step over the two INIT statements to get to the first statement of their program. Either the INIT block should be changed to a CHECK block, or $DB::single=2 statements should be inserted to step over the INIT statements, like this:
196 #==============================================================================
197 # Process delayed objects that don't have source code yet.
198 #==============================================================================
199 # This code is an ugly hack because of the fact that you can't use an
200 # INIT block at "run-time proper". So we kill the warning and tell users
201 # to use an Inline->init() call if they run into problems. (rare)
202
203 eval <<'END';
204 no warnings;
205 $INIT = $INIT; # Needed by Sarathy's patch.
206 sub INIT {
$DB::single=2; # make debugger skip over next statement
207 $INIT++;
$DB::single=2; # make debugger skip over next statement
208 &init;
209 }
210 END
Please implement one of my two proposals, or some other way to avoid this "ugly hack" and allow the Perl debugger to start where a script writer would expected it to.
Thank you!
-Shaun
The text was updated successfully, but these errors were encountered:
The "ugly hack" in Inline.pm is impacting the debugging of scripts (the INIT block is being intercepted by the Perl debugger). Here is the problematic code:
When the Perl debugger launches for a script which uses Inline or a module which uses Inline, the debugger will start at line 206 of Inline instead of the first executable statement of the script. Hence, the INIT block in Inline.pm forces the script writer to step over the two INIT statements to get to the first statement of their program. Either the INIT block should be changed to a CHECK block, or $DB::single=2 statements should be inserted to step over the INIT statements, like this:
Please implement one of my two proposals, or some other way to avoid this "ugly hack" and allow the Perl debugger to start where a script writer would expected it to.
Thank you!
-Shaun
The text was updated successfully, but these errors were encountered: