How do I use a Perl module from a relative location?

前端 未结 8 2156
予麋鹿
予麋鹿 2020-12-23 16:41

I have a dir called foo, and in that I have lib and bin. The scripts in bin need stuff in lib. I do someth

8条回答
  •  一生所求
    2020-12-23 17:21

    How about:

    BEGIN: {
        push @INC, '/full/path/to/lib';
    }
    

    To do a relative reference would assume that you're going to keep it in the bin dir, so insert the relative reference there instead.

提交回复
热议问题