How to create single BIG program with all values of variables by parsing a perl program For e.g. following is a code will loop through 5 times:

#!/usr/bin/perl -w use strict; use warnings; sub myLoop( $ ) { my $a = shift; print "Loop: $a\n"; } my $a = 1; while( $a < 5 ) { myLoop( $a ); $a++; } print "After loop: \$a=$a\n";

I want to create a single BIG program with all the possible VALUES using the above script as input and the single program should contain all the values each time the myLoop() is executed. Is there any CPAN module to achieve this? i need this because this helps for debugging and want to use this program to output in HTML format with each LOOP as "OK" of "NOT OK". This will help in identifying with what input the script failed. The possible output i am looking is:

sub myLoop( 1 ) { my $a = shift; print "Loop: 1\n"; } sub myLoop( 2 ) { my $a = shift; print "Loop: 2\n"; } sub myLoop( 3 ) { my $a = shift; print "Loop: 3\n"; } sub myLoop( 4 ) { my $a = shift; print "Loop: 4\n"; } print "After loop: \$a=5\n";

In reply to Ho wo create single BIG program with all values of variables by parsing a perl program by dineshbhatta1973

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.