Subdirectories and use lib
I'd like to organize a project's files into subdirectories for =
better housekeeping. I thought that use lib "."; would also include any =
subdirectories, but sadly it doesn't. Is there a way to include all =
subdirs without having a list a mile long like this?
use lib "/Applications/MAMP/cgi-bin/cart/sql/lib/Module/";
use lib "/Applications/MAMP/cgi-bin/cart/sql/lib/Params/";
use lib "/Applications/MAMP/cgi-bin/cart/sql/Business/CreditFraud/";
etc...
Or am I going about it the wrong way?
Thanks,
Marc=
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Subdirectories and use lib
Hi Marc,
On Wed, 20 Jul 2011 15:38:06 -0700
Marc <sono-io [at] fannullone.us> wrote:
> I'd like to organize a project's files into subdirectories for better
> housekeeping. I thought that use lib "."; would also include any
> subdirectories, but sadly it doesn't. Is there a way to include all subd=
irs
> without having a list a mile long like this?
> use lib "/Applications/MAMP/cgi-bin/cart/sql/lib/Module/";
> use lib "/Applications/MAMP/cgi-bin/cart/sql/lib/Params/";
> use lib "/Applications/MAMP/cgi-bin/cart/sql/Business/CreditFraud/"; etc.=
...
>
> Or am I going about it the wrong way?
>
I think you are.
You can load modules from lib using "use Module::SubModule;" or "use
Params::Validate" - no need to load all subdirectories. Just use "::" for
loading stuff in sub-directories. For more information see:
http://perl-begin.org/topics/modules-and-packages/
Regards,
Shlomi Fish
> Thanks,
> Marc
--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap
<mst> I find it=E2=80=99s usually safe to assume that whatever shlomif=E2=
=80=99s doing, there
isn=E2=80=99t a good reason for it.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Subdirectories and use lib
Hi Marc,
On Thu, 21 Jul 2011 08:40:44 -0700
Marc <sono-io [at] fannullone.us> wrote:
> On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote:
>
> > You can load modules from lib using "use Module::SubModule;" or "use
> > Params::Validate" - no need to load all subdirectories. Just use "::" =
for
> > loading stuff in sub-directories.
>
> Thanks, Shlomi. That's all it took to get it to sink in.
You're welcome.
>
> > http://perl-begin.org/topics/modules-and-packages/
>
> I went back and re-read chapter 10 of "Beginning Perl" and it
> _finally_ makes sense to me now.
That's good.
>
> Thanks again,
> Marc
>
>
> BTW, I would like to thank everyone who responds to questions like these =
on
> this list. I've read "Beginning Perl" twice, "Learning Perl", and a coup=
le
> of others, but sometimes things just don't sink in until someone goes out=
of
> their way to give a simple explanation, and then it's like a switch has b=
een
> thrown.
>
> So, sincerely, thanks to everyone here who's willing to help. I'm sure it
> can be frustrating at times to put up with these questions, but it really
> does make a difference.
Thanks for the comment - it made me happier. I'm glad to see our help is be=
ing
appreciated.
BTW, if you want to get very quick answers to simple (and
not-so-simple) questions, feel free to come to #perl on the Freenode Intern=
et
Relay Chat (IRC) network:
http://perl-begin.org/irc/
Regards,
Shlomi Fish
--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
Apple Inc. is Evil - http://www.shlomifish.org/open-source/anti/apple/
To have bugs is human; to fix them =E2=80=94 divine.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Subdirectories and use lib
On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote:
> You can load modules from lib using "use Module::SubModule;" or "use =
Params::Validate" - no need to load all subdirectories. Just use "::" =
for loading stuff in sub-directories.
Thanks, Shlomi. That's all it took to get it to sink in.
> http://perl-begin.org/topics/modules-and-packages/
I went back and re-read chapter 10 of "Beginning Perl" and it =
_finally_ makes sense to me now.
Thanks again,
Marc
BTW, I would like to thank everyone who responds to questions like these =
on this list. I've read "Beginning Perl" twice, "Learning Perl", and a =
couple of others, but sometimes things just don't sink in until someone =
goes out of their way to give a simple explanation, and then it's like a =
switch has been thrown.
So, sincerely, thanks to everyone here who's willing to help. I'm sure =
it can be frustrating at times to put up with these questions, but it =
really does make a difference.=
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/