Update: resolved and further explored here http://perlmonks.org/index.pl?node_id=1076241

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:

system("osascript", "-e", "tell application \"BBEdit\" tell the text of the front window select insertion point before line $line end tell end tell");
I've already verified that it works as a pre-prompt command in Perl debug:

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.