小编Str*_*ind的帖子

如果脚本在Windows上运行,我如何确保加载模块?

我有一个需要在Windows和Linux上运行的Perl脚本.问题是我需要use一个仅适用于Windows的Perl模块.

我试过下面的,但它仍然包括你的WindowsStuff包.

use strict;
if ($^O eq 'MSWin32' ){
    use My::WindowsStuff;
}
use File::Basename;
use Getopt::Long;
...
...
Run Code Online (Sandbox Code Playgroud)

linux windows perl module perl-module

4
推荐指数
1
解决办法
97
查看次数

标签 统计

linux ×1

module ×1

perl ×1

perl-module ×1

windows ×1