in reply to How to parse these command-line options?

You could just use Getopt::Long and localize the parameters first set of parameters in @ARGV, get the next set localize @ARGV again. For example:
use strict; use warnings; use Getopt::Long; my @current_params; my $counter; while ( @current_params = get_next_set() ) { $counter++; print "\nloop $counter:"; local @ARGV = @current_params; my ($alpha,$beta,$gamma); GetOptions ( 'Alpha|a' => \$alpha, 'Beta|b' => \$beta, 'Gamma|g' => \$gamma, ); if ( $alpha ) { print "ALPHA FOUND." } if ( $beta ) { print "BETA FOUND." } if ( $gamma ) { print "GAMMA FOUND." } } ######################## sub get_next_set ######################## { my @temp_set; while ( @ARGV ) { push @temp_set,shift @ARGV; last if $temp_set[$#temp_set] !~ /^-/ and defined $ARGV[0] and $ARGV[0] =~ /^-/; } return @temp_set; } ##get_next_set
Which produces something like the following:
E:\>232942.pl -a -b FOO BAR -a -b -g BAR FOO -a -g FOO loop 1:ALPHA FOUND.BETA FOUND. loop 2:ALPHA FOUND.BETA FOUND.GAMMA FOUND. loop 3:ALPHA FOUND.GAMMA FOUND. E:\>
Anyhow this is the first thing that came to mind when I read your post. And I would like to hear what problems, nuances, I might have overlooked.

-enlil