core_dumped has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks!
I have been sometime (several years on a pilgrimage) away from larger-than-one-file Perl scripts and I have found problems using my own modules.
I learned the current working directory has been removed from @INC as a default and found a FindBin recipe in some website. However, I don't seem to understand it correctly. Please some advice.
This is my script, which uses my own module called "basedat" (to connect to a database and hide all the ugly details):
#!/usr/bin/perl # Connection to database use FindBin qw($Bin); use basedat "$Bin/basedat"; $dbh = basedat::new(); if (defined($dbh)) { print "connection ok!\n"; }
Both, this script and my module, called basedat.pm, are in the same directory. Yet, when executed the script still says it cannot locate basedat.pm.
Any light you could shed would be greatly appreciated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cannot find my own modules
by haukex (Archbishop) on Sep 11, 2018 at 17:30 UTC | |
by core_dumped (Acolyte) on Sep 11, 2018 at 20:05 UTC | |
|
Re: Cannot find my own modules
by Anonymous Monk on Sep 12, 2018 at 03:08 UTC |