但是,就像楼上所说,system调用系统命令肯定没有问题。
可以通过全局变量$OSNAME/$^O来区分操作系统,变量解释如下:
$OSNAME
$^O
The name of the operating system under which this copy of Perl was built, as determined during the configuration process. The value is identical to $Config{'osname…
[/Quote]又学到了。。。
但是,就像楼上所说,system调用系统命令肯定没有问题。
可以通过全局变量$OSNAME/$^O来区分操作系统,变量解释如下:
$OSNAME
$^O
The name of the operating system under which this copy of Perl was built, as determined during the configuration process. The value is identical to $Config{'osname'}. See also the Config manpage and the -V command-line switch documented in the perlrun manpage.
In Windows platforms, $^O is not very helpful: since it is always MSWin32, it doesn't tell the difference between 95/98/ME/NT/2000/XP/CE/.NET. Use Win32::GetOSName() or Win32::GetOSVersion() (see the Win32 manpage and the perlport manpage) to distinguish between the variants.