我有一段代码使用了很多实验性的功能(whensmartmatchgiven),这不是我的代码,并且我不想看到很多有关实验性功能的警告。因此,我在此代码中添加了no warnings 'experimental';。但是experimental类别仅在perl 5.18中添加,因此我的代码在较旧的perls中死亡:



如何禁用此警告,并且不破坏较旧的Perl的代码?

最佳答案

尝试if:

no if ($] >= 5.018), 'warnings' => 'experimental';

关于Perl在旧的Perl上没有警告 'experimental',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24653096/

10-09 06:13