Thank you for the replies, especially the warning about potential problem with Perl/Tk under Windows
Based on the reading I did prior to posting my question leads me to believe that know (falsely ??) HOW to install modules, but my question is WHERE guided by best practice & experience.
My installation of Perl created the directory C:\Strawberry on my PC together with sub-directories such as \c and \cpan and \perl and \win32 and within those further sub-directories such as c:\Strawberry\cpan\sources\modules
My instinct is to regard the installation of Mapivi as a separate “project” perhaps creating another directory such as c:\perl_project_mapivi
I knew from the installation notes that Mapivi requires Perl/Tk plus other Perl modules (in CPAN) however I am seeking recommendations regarding the Directory Structure to adopt because I realise that I'll have to subsequently handle (at minimum) revision of Strawberry Perl, new version of Mapivi, updates to required modules, and the inclusion of self-written code.
Experience says that adopting an appropriate directory structure at the outset of using a new language can ease subsequent changes and the evolution to further projects, hence my request for recommendations from wise monks or pointers to documentation that I've not yet been able to find.
Many thanks in advance
| [reply] |
I see. When you install Perl modules (e.g., Tk) through automated 'cpan' or "manually" by downloading, gunzip, tar xf, and then the magical incantation (perl Makefile.PL, dmake, dmake test, dmake install) they will automatically be put in the appropriate directories for your installation - with Strawberry, most likely C:\Strawberry\perl\site\lib. This way, any Perl programs you write will be able to find them.
For a separate "program" which will "use" Perl and the installed modules, you can put it anywhere you'd like. Some considerations, if it's command line, you may want the directory to be in your %PATH% environment variable. For example, I have a C:\usr\bin directory and added it to my path and it contains all the GnuWin32 tools as well as some Perl scripts I've written so when I open a cmd.exe Command Prompt, I can just type the Perl script name and it will run (you'll also need %PATHEXT% to include '.pl', but Strawberry installation generally takes care of this for you).
I also have a Perl "project" - a script with many of it's own supporting modules not on CPAN, but available at GitHub, that I put into a sub-folder of C:\usr\bin (C:\usr\bin\ppc) and then created a batch file (ppc.bat) in C:\usr\bin that points to the Perl script (C:\usr\bin\ppc\bin\ppc.pl). This to limit the amount of folders in my %PATH% variable (as I have other projects setup this way).
All of this way too much information? Maybe, but hopefully it shows you have some options and nothing says you can't change it later. So long as Perl and its CPAN modules are installed to their "default" location, things should for the most part run pretty smoothly.
Hope that helps a little more.
| [reply] |
| [reply] |