navrattanbansal has asked for the wisdom of the Perl Monks concerning the following question:

I am new for Perl I want to ask one question. I have around 50 custom packages which i am using in my Perl script. I want to import all .pm packages in my Perl script in an easy way. Right now i have to import each package individually. So Is there any way to do so??

Right Now i am doing like:
use pack1; use pack2; ...... use pack50;
But I want some easy way Like
use Pack*;
This is just an example from my way but you can give me any solution.

Replies are listed 'Best First'.
Re: How can i do one liner import multiple custom .pm files in my perl script
by chromatic (Archbishop) on Apr 10, 2012 at 06:21 UTC

    Audrey's use looks like a great approach.

    With that said, 50 packages seems like a lot. What are you doing that you have so many?


    Improve your skills with Modern Perl: the free book.

      hey actually i have separate package for single subroutine. I want each subroutine in separate file. So Is there any way that i can keep my each subroutine in separate file. So that i can use all of them in my perl script. ?????

        I don't know if I would choose to do it this way, but perhaps Module::Pluggable would help to do what you want. You should be able to set a class prefix on each module to be loaded.

        Update: Ugh - didn't notice that it was in the list provided below.

        --MidLifeXis

Re: How can i do one liner import multiple custom .pm files in my perl script
by Anonymous Monk on Apr 10, 2012 at 06:22 UTC