用perl调用dos执行perl脚本有什么不同?

时间:2013-11-13 18:12:33

标签: perl perl-module win32ole ansi-colors

为什么这样做?

test2color.pl包含:

#! perl -slw
use strict;
use Win32::Console::ANSI;
use Term::ANSIColor qw(:constants);

print BLACK, ON_WHITE, "black on white\n";
print WHITE, ON_BLACK, "white on black\n";
print GREEN, ON_CYAN, BLINK, "garish!\n";
print RESET;

输出:

enter image description here

1 个答案:

答案 0 :(得分:6)

你的

H:\test\perl>perl test2color.pl

使用它在PATH环境变量中找到的第一个perl(.exe)。这可能是你的cygwin安装的perl。

H:\test\perl>test2color.pl

使用操作系统信息将扩展名.pl与将运行所有.pl的特定命令行/可执行文件相关联。 ftypeassoc可用于显示/操纵这些关联。

我认为.pl的ftype指向 - 完全不同 - c:\Perl\bin\perl.exe