How do I include a Perl module that's in a different directory?

后端 未结 6 2425
天涯浪人
天涯浪人 2020-12-07 16:32

How do I include a Perl module that\'s in a different directory? It needs to be a relative path from the module that\'s including it.

I\'ve tried

p         


        
6条回答
  •  悲哀的现实
    2020-12-07 17:14

    I'm surprised nobody has mentioned it before, but FindBin::libs will always find your libs as it searches in all reasonable places relative to the location of your script.

    #!/usr/bin/perl
    use FindBin::libs;
    use ;
    

提交回复
热议问题