In Perl, what is the difference between a .pm (Perl module) and .pl (Perl script) file?

后端 未结 2 2009
故里飘歌
故里飘歌 2020-12-07 11:58

What is the Difference between .pm (Perl module) and .pl (Perl script) file?

Please also tell me why we return 1 from file. If

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

    A .pl is a single script.

    In .pm (Perl Module) you have functions that you can use from other Perl scripts:

    A Perl module is a self-contained piece of Perl code that can be used by a Perl program or by other Perl modules. It is conceptually similar to a C link library, or a C++ class.

提交回复
热议问题