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!

"Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.

In reply to Embedding command-line arguments within source code by morelenmir

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.