Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Directory Structure Recommendations

by VinsWorldcom (Prior)
on Mar 20, 2017 at 18:34 UTC ( [id://1185274]=note: print w/replies, xml ) Need Help??


in reply to Directory Structure Recommendations

Note you may have trouble getting Tk to install on Windows. I couldn't get it to build with the 'cpan' automated install. I needed to download the package, 'gunzip' and 'tar xf' into my ~/Downloads directory and then follow the advice here:

Re: Problem installing TK module

  • Comment on Re: Directory Structure Recommendations

Replies are listed 'Best First'.
Re^2: Directory Structure Recommendations
by Ossie (Novice) on Mar 22, 2017 at 12:09 UTC

    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

      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.

        Yep - that indeed IS the depth I am considering and trying to create appropriately.

        Many thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found