What are some good Perl debugging methods?

前端 未结 18 1139
南笙
南笙 2020-12-12 21:12

Are there other ways for debugging Perl programs apart from Data::Dumper and perl -d?

18条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 21:43

    Depending on what you're doing, Log::Log4perl provides an easy way to manage the 'print' style of debugging particularly in bigger applications:

    • provides various logging levels (Debug, Info, Error, Warning, and Fatal)
    • controlled from configuration files (easy to have debugging on development box, only errors on production box, for example)
    • configurable by sections of your application (e.g., web application in one log file at one level, cron scripts in another at a different log level)
    • configurable by class - easy to quieten noisy modules, or add detailed debugging to somewhere deep within an application

提交回复
热议问题