I'm trying to insert a little pre-prompt script into the Perl debugger which makes my source editor follow along with its cursor in the open source file window while I'm tracing the source code on the command line.
In my case the editor is BBEdit on the Mac, so I'm using this command to update the cursor position from Perl, which already works so far from a regular script:
I've already verified that it works as a pre-prompt command in Perl debug:system("osascript", "-e", "tell application \"BBEdit\" tell the text of the front window select insertion point before line $line end tell end tell");
DB<34> < system("osascript", "-e", "tell application \"BBEdit\"\n tell the text of the front window\n select insertion point before line $line\n end tell\nend tell");
Whenever I change $line in the debugger, the editor cursor jumps to its new line number. So almost all of it already works.
(It executes an AppleScript snippet from the command line which moves the cursor in the open BBEdit GUI application.)
The thing is that I would need to know where to get the current tracing line number from within the debugger, so I can insert this instead of $line as a pre-prompt Perl command which should then slave the editor cursor to the current tracing location in the debugger.
I've just not found such a debugger variable yet; The special Perl variable listings here and on perldocs don't seem to indicate such a variable as far as I can see thus far.
Any ideas? Have I just overlooked such a variable or do I have to patch the debugger to get it?
In reply to Update: homespun GUI Wrapper for the Perl Debugger with an auto-refreshing editor (BBEdit on Mac OS X) (was: Perl Debugger: Is there a variable with the current source line number being traced?) by Shoveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |