use Getopt::Std; #### use strict; use warnings; #### use List::Util 'shuffle'; #### getopts('r:n:v', \%opt) or usage(); #### sub usage { print STDERR "Usage: $0 [-n N] [-r] [-v] command arg1 arg2... Run command arg1, command arg2, etc., concurrently. Run no more than N processes simultaneously (default 1) -r: run commands in random order instead of specified order (unimpl.) -v: verbose mode "; exit 1; #### sub USAGE () { my $name=basename $0; # File::Basename's <<".EOT"; Usage: $name [args] [actual usage here] .EOT }