http://qs321.pair.com?node_id=1173279


in reply to How to execute multiple commands through perl script

What happens when you execute

my $cmd2 = "start cmd /k cd c:\PerlExamples && $cmd"; system ($cmd2);
or putting it the other way around: get executing the combined command as you wish, and then you would also be able to run it in your loop. Btw.: printing the command (in my case $cmd2) shows you how perl does substitution inside paranthesis (" or ')

Hope this helps you! Rata

Replies are listed 'Best First'.
Re^2: How to execute multiple commands through perl script
by Anonymous Monk on Oct 04, 2016 at 20:03 UTC

    This again creates a new command prompt window and paths to my directory but executes the example script in the original window.