Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Here's a first draft, incomplete implementation a possible response to my notion (YMMV) that Perl's CLI debugger is intimidating to novices (well, it was to me... for several years).

IOW, here's a simple-minded, do-nothing, little script that invites the user to explore some debugger commands in circumstances in which s/he need not fear will be tantamount to rm rf (or del *.* /s, if 'doze in the learner's OS flavor).

My hope is that the minimal set of operations in the script give a hint of (or maybe "are extensive enough for a start?") the range of debugger options/commands which the user would be well advised to learn.

The specific RFC follows the code:

#!/usr/bin/perl use 5.014; # modify to match your "perl -v" unless (@ARGV) { say "debugger practice; on restart, 1st arg must be a number\n"; exit; } say "Explore debugger commands w expr W expr b Ln|Event B Ln|Event (et +c incl l v s n)\n"; my ($var1, $var2, $var3); my @arr = qw (a b c d e f g); sub testable { # useless uninformative comment my $subvar1 = shift; say "\t In sub testable, \$var1: $var1"; my $subvar2 = shift; say "\t AS PASSED TO SUB, \$var2: $var2"; $subvar2 *= 5; say "\t In sub testable, \$subvar2: $subvar2"; my $subvar_rand_int = int(rand($subvar2)); say "\t In sub, \$subvar_rand_int is: $subvar_rand_int."; return $subvar_rand_int; # to $result } chomp($var1 = shift); $var2 = int(3*$var1); say "Pre_sub, \$var1: $var1 and \$var2: $var2"; push my @pass_to_sub,$var1; push @pass_to_sub,$var2; my $result = testable(@pass_to_sub); say "Back from sub with \$result: $result"; # another comment for exploration of the deugger for $_(@arr) { $_ .= "_foo"; say "$_ " x $result; say "\n"; }

So, the question: are this notion and this approach worth pursuing, further, with additional scripts focusing on packages, OO, modules, etc... If so, where should that focus begin?

Or should one, IYO, focus instead on getting noobs to use some of the available (often for $$$) GUI debuggers/other debuggers?


In reply to RFC: debugger_trainer by ww

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (12)
    As of 2014-08-27 17:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (248 votes), past polls