Try using "my" in a REPL and you won't fair any better.

Yes, yes, I know, with some arcane commands and such I can get the debugger to do those thing, but why should I have too?

Yes, yes, I know, if one bothers to even take a few minutes to look up just the barest of information about these "arcane" commands, one would likely quite quickly find "x" which is all that is needed to make "perl -dex" a REPL. But why bother when one can instead spend that time composing a node to demonstrate how little one knows about the debugger and how uninterested one is in learning more. :)

% perl -dex DB<1> x @foo= 1..10 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 DB<2> x "@foo" 0 '1 2 3 4 5 6 7 8 9 10' DB<3>
But seriously, a debugger is so not a REPL.

No, it is much more useful. It is just trivial to use it as a REPL and is always handy on any standard Perl installation.

A REPL is useful for experimenting. A debugger is also useful for experimenting but is even more useful for experimenting in the context of the middle of some script or module code.

When I wrote each Win32API:: module I would use the Perl debugger to experiment with the API that I had just wrapped in order to document it properly (the official API documentation was usually vague about several interesting points, for example).

- tye        


In reply to Re^3: RFC: IPerl - Interactive Perl ( read-eval-print loop ) (-de_) by tye
in thread RFC: IPerl - Interactive Perl ( read-eval-print loop ) by mseabrook

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.