How do I get perl -c to throw Undefined or Undeclared function errors?

前端 未结 4 1216
陌清茗
陌清茗 2020-12-09 20:09

Coming from a C++ background, I religiously use the use strict and use warnings features of Perl:

#!/usr/bin/perl -w
use strict;
us         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 20:56

    Perl cannot possibly know at compile time that there won't be a sub to call once the sub call is reached, so -c cannot possibly tell you that.

    perlcritic is a tool designed to scan Perl code and guess at possible problems like this one. The Perl::Critic::StricterSubs perlcritic rule checks for this problem.

提交回复
热议问题