在新打开的命令提示符下运行PERL脚本? [英] Running PERL script on newly opened command prompt?

查看:109
本文介绍了在新打开的命令提示符下运行PERL脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以下内容:

1.我想用PERL脚本打开一个新的命令提示符窗口. 2.在该窗口上运行剩余的PERL脚本.

该怎么做?

如果您知道的话,请回答我.

这对我来说是非常紧急的帮助.........

I need the following:

1. I want to open a new command prompt window with PERL script
2. Run the remaining PERL script on that window.

How to do this?

Please answer me if you know.

this is very urgent help me............

推荐答案

您可能需要更具体地说明您的目标,但是从您所说的来看,我认为您不能让一个脚本以您提到的方式部分在一个CMD窗口中执行,而部分在另一个CMD窗口中执行.如果要使用多个版本的脚本,则应查看 fork [
You may need to be more specific about your goals, but from what you''ve said, I do not think you can have a single script execute partly in one CMD window and partly in another one in the way you mention. If you want multiple versions of a script operating you should look into fork[^]which will let you create a new child process running the same script from the same point as the original parent. Note that this requires some care in what you are doing to keep the various copies coordinated and controlled!


However you could have one script create a shell that then executes another script, something like this trivial example:

perl -e "system 'start CMD /k perl -v'"


如果您在CMD提示符下将其作为命令运行,它将打开一个新的独立CMD窗口,并使其带有-v选项运行Perl,然后保持打开状态(或在运行后使用/c关闭-检查帮助其他选项的CMD).您可以将-v替换为要执行的另一个Perl脚本的名称.


If you run that as a command at your CMD prompt, it will open a new independent CMD window and cause it to run Perl with the -v option, and then remain open afterwards (or use /c to close after the run - check HELP CMD for other options). You could replace the -v with the name of another Perl script to execute.


这篇关于在新打开的命令提示符下运行PERL脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆