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";