... my $argument = something; my $argument2 = somthing else; $argument = "'".$argument."'"; #surround in quotes $argument2 = "'".$argument2."'"; #surround in quotes $exec_string = "$program $argument $argument2"; system("$exec_string"); ... #### ... $argument=~s/'/'"'"'/g; ...