here is the skeleton script that i am using:
#!/usr/bin/env perl
=head1 NAME
webapp-1 harness - webapp-1 test
=head1 SYNOPSIS
webapp-1 [OPTION]
-v, --verbose use verbose mode
--help print this help message
Where OPTION is an integer governing the number of times the script should be run
Examples:
webapp-1 10
=head1 DESCRIPTION
This is test harness to verify jira issue WEBAPP-1
=head1 AUTHOR
skahmed@mmm.com
=cut
use strict;
use warnings;
use Getopt::Long qw(:config auto_help);
use Pod::Usage;
my $count = $ARGV;
main();
sub main {
# Argument parsing
my $verbose;
GetOptions(
'verbose' => \$verbose,
) or pod2usage(1);
pod2usage(1)unless @ARGV;
while ($count) {
printf "$count \n";
# Here i want to run a perl script N number of times, with N being the ARGV to this command
# capture( [0,1,2, $^X, "yourscript.pl", @ARGS );
$count++;
}
}
I also cannot use IPC::System since i cannot install it on the host (ubuntu 12.04) i am running it on. What i am trying to do is to develop a perl test harness, which will run perl scripts to run processes, monitor database tables, etc and i can also control the timing of these scripts, based on the results i get from their execution.
one possible solution: for running a script N number of times based on @ARGV
foreach (1..$ARGV[0])
{
print "hello \n";
}