How do you create a Perl module?

后端 未结 8 1843
醉话见心
醉话见心 2020-12-13 21:03

How do you write a module for Perl? In Python you can use:

# module.py
def helloworld(name):
    print \"Hello, %s\" % name

# main.py
import module
module.         


        
8条回答
  •  执笔经年
    2020-12-13 21:22

    The last third of Intermediate Perl is devoted to module creation.

    Whenever you want to know how to do something in Perl, check perltoc, the table of contents for the Perl documentation:

    % perldoc perltoc
    

    Several parts of the core Perl documentation can help you:

    • perlmod
    • perlmodlib
    • perlmodstyle
    • perlnewmod

    • perltoot: Tom's Object-Oriented Tutorial

    • perlboot: Barnyard Object-Oriented Tutorial

    Good luck,

提交回复
热议问题