I am going out on a limb here, because even though I've researched it a bit, it's always dangerous to say, "No, there's no other way." Rather than to say that, I'll mention my gut feeling after having re-read perldebug, perldebtut and perlrun.
What I kind of picked up on in perldebug was this line:
...the -d flag tells the compiler to insert source information into the parse trees it's about to hand off to the interpreter.
So we can first understand that without the -d flag, the compiler doesn't insert into the parse trees the source info necessary to implement the debugger. That means that the script must at least be invoked with the -d flag so that the compiletime work is done that will enable the debugger to work.
Now that we know that the -d flag must be present, the only question is, is there a way to invoke the debugger at compiletime but not have the interpreter invoke it except on demand? Re-reading perldebug and perlrun, I just don't see a way of doing that. But I'm definately not a debugger expert, and it's possible that someone more familiar with using the debugger will know what the trick is. My intuition is that there isn't a pure-Perl solution to your need though.
However, all may not be lost. Look at the Devel:: heirarchy on CPAN. There is a wide range of development tools there, and some allow for runtime control. You haven't told us what it is that you need from the debugger, but I'm just suggesting that maybe you can satisfy the need with a tool other than the debugger; perhaps a Devel:: module.
I hope this helps. I've done more reading on the subject than I initially intended to, but it was an interesting question.
Dave
In reply to Re: Re: Re: perl -d at runtime?
by davido
in thread perl -d at runtime?
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |