I'm not sure this is a Perl question: can you do what you've described from the CLI?
If so, system or backticks might offer an approach whereas open is -- as perldoc -f open will tell you -- for opening a file; not for executing it.
If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.
Comment on Re: selecting specific command prompt from multiple command promt