how to import multiple custom modules in our own perl script?

前端 未结 2 952
感动是毒
感动是毒 2021-01-25 01:38

I have say 100 custom packages like (file1.pm, file2.pm, file3.pm, file4.pm, file5.pm, file6.pm )

Each file contains one function.

i want to import all in my eve

相关标签:
2条回答
  • 2021-01-25 01:44

    You can use this small script to load all 100 modules into it:

    # pragma
    use strict;
    use warnings;
    
    # standard modules needed by the script
    use Module::Load;
    
    # the loop below loads all 100 of your custom modules (file1.pm, file2.pm, ...)
    foreach my $i (1 .. 100)
    {
        load "file$i";
    }
    
    0 讨论(0)
  • 2021-01-25 01:59

    As I said in a comment, I think this is a terrible way to organise your codebase. But assuming that you can't do anything about that, you might want to look at the Toolkit module.

    0 讨论(0)
提交回复
热议问题