morelenmir has asked for the wisdom of the Perl Monks concerning the following question:
I am currently in the process of moving from EPIC and Eclipse to writing my Perl programmes with a straightforward text editor and then debugging with the native debugger. For me the two most useful features of EPIC were the ability to set a breakpoint visually by clicking in the left margin and also being able to specify the command-line arguments for a script.
So far as setting breakpoints goes I have learned it is possible to do effectively the same thing in a text editor by adding $DB::single = 1; at the position in the source where you want the debugger to halt. However I have not yet found a way of pre-specifying the command-line arguments for a script within the source code. Is this possible? I always use GetOpt::Long to unpack and access any passed arguments. Therefore one idea that strikes me is to manually set the contents of $ARGV[n] at the top of the source before any other code is run. Would this approach work?
Any suggestions or insight in this matter would be much apreciated!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Embedding command-line arguments within source code
by haukex (Archbishop) on May 20, 2018 at 18:04 UTC | |
|
Re: Embedding command-line arguments within source code
by Discipulus (Canon) on May 20, 2018 at 18:36 UTC | |
by morelenmir (Beadle) on May 20, 2018 at 18:58 UTC | |
|
Re: Embedding command-line arguments within source code
by LanX (Saint) on May 21, 2018 at 12:24 UTC | |
|
Re: Embedding command-line arguments within source code
by ikegami (Patriarch) on May 20, 2018 at 22:05 UTC | |
by Anonymous Monk on May 21, 2018 at 00:37 UTC |