Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to execute multiple commands through perl script

by Ratazong (Monsignor)
on Oct 04, 2016 at 19:44 UTC ( #1173279=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1173279]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2020-05-26 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?