in reply to pass command line parameters

Im not convinced that what you are doing is the correct way to your goal (which I am unsure exactly what that is).

I would have code handle all arguments via initial command line, then branch out depending on what needed to be done. If you needed to call a new module or script, do it via code, not via the command line.

Here is my crappy (super duper crappy wappy) possibility to your probable goal :
use strict; my $a_a_switch_param; my $a_b_switch_param; my $c_b_switch_param; my $b_a_switch_param; my $b_b_switch_param; for (my $argcnt=0;$argcnt<=$#ARGV;$argcnt++) { my $arg=$ARGV[$argcnt]; if($arg eq "-a") { $argcnt++; $a_a_switch_param=$ARGV[$argcnt]; }elsif($arg eq "-b") { $argcnt++; $a_b_switch_param=$ARGV[$argcnt]; }elsif($arg eq "-c") { $argcnt++; $a_c_switch_param=$ARGV[$argcnt]; }elsif($arg eq "-ba") { $argcnt++; $b_a_switch_param=$ARGV[$argcnt]; }elsif($arg eq "-bb") { $argcnt++; $b_b_switch_param=$ARGV[$argcnt]; } } my $b_prog_output=qx/perl b.pl $b_a_switch_param $b_b_switch_param/;