if($command_line_switch =~ /hello/) { # program 1 code } if($command_line_switch =~ /goodbye/) { # program 2 code }