How to use CPAN module in perl script that I want to provide to others?

I am writing a Perl script that takes data and writes it to an Excel file. I use Excel::Writer::XLSXto do this.

I hope to write a script and then pass it to the rest of my command so that we can use it to compile the data when we need to.

I have a few questions about this:

  • Should my colleagues have a module installed for the script to work?

  • If not, how can I complete the module with a script to give them this?

  • Is there a better way to do this using the module I selected?

+4
source share
3 answers

. - Makefile.PL, . script . .

use ExtUtils::MakeMaker;

WriteMakefile(
    ABSTRACT          => 'myscript creates Excel files',
    AUTHOR            => 'A.U. Thor',
    EXE_FILES         => [ 'myscript' ],
    NAME              => 'myscript',
    VERSION           => '1.2.3',

    PREREQ_PM => {
        'Excel::Writer::XLSX' => '0.88',
    },
);

perl Makefile.PL, . make dist , cpanm script .

- cpanfile. , cpanm.

, script , Perl , , .., pp.

+5

- , scriptdist, , CPAN, . , , CPAN. , . Dr. .

, , . cpan . ( ):

 $ cpan .

, , CPAN- .

+3

,

script?

, ,

, , , use

, script, ?

" " . , , " script", ,

" script" , , ? , , script use

, use, , @INC. , , , .

() ?

Excel::Writer::XLSX ?

Excel::Writer::XLSX , , , , shgouldn't . , .

-4

Source: https://habr.com/ru/post/1629589/


All Articles