I have a set of .EXE commands. How do I get all those commands run in Perl as a single file? Whats the process to call the .EXE files in Perl?
我有一组.EXE命令。如何将Perl中运行的所有命令作为单个文件?什么是在Perl中调用.EXE文件的过程?
2 个解决方案
#1
The Perl system()
function will do this:
Perl system()函数将执行此操作:
#!/usr/bin/perl -w
system("prog1.exe");
system("prog2.exe");
#2
TThe way to call system commands from perl is to use
从perl调用系统命令的方法是使用
system("String containing command + args here")
or if you want to perform some processing on the output, you use backticks
或者如果要对输出执行某些处理,则使用反引号
`command + args here`
You can use all your normal perl string manipulation oneliners with the backtick as well.
您也可以使用带有反引号的所有普通perl字符串操作oneliner。
#1
The Perl system()
function will do this:
Perl system()函数将执行此操作:
#!/usr/bin/perl -w
system("prog1.exe");
system("prog2.exe");
#2
TThe way to call system commands from perl is to use
从perl调用系统命令的方法是使用
system("String containing command + args here")
or if you want to perform some processing on the output, you use backticks
或者如果要对输出执行某些处理,则使用反引号
`command + args here`
You can use all your normal perl string manipulation oneliners with the backtick as well.
您也可以使用带有反引号的所有普通perl字符串操作oneliner。