in reply to Re: Re: perl -d at runtime?
in thread perl -d at runtime?

I ended up stripping the -d arg and using exec.
#!/usr/bin/perl -w BEGIN { # handle -d by itself to start the debugger @ARGV = grep { $_ eq '-d' ? !($opt_d=1) : 1 } @ARGV; exec('/usr/bin/perl','-dS',$0,@ARGV) if $opt_d; } ...
Note that this doesn't do clustering like smarter switch process.

Also, I don't know if I need that -S but it's not hurting yet.