jacques has asked for the wisdom of the Perl Monks concerning the following question:

When someone is installing my module, I want to give them the option of choosing the owner of the module file and changing permissions, so only the owner can use the module after installation.

So I thought of putting something in the makefile. But I am wondering how would others go about doing this? Would you use File::Chmod and Win32::File?

Has this been implemented already in another CPAN module? (The million dollar question.)

  • Comment on Setting up a module's ownership in the makefile

Replies are listed 'Best First'.
Re: Setting up a module's ownership in the makefile
by friedo (Prior) on Aug 25, 2005 at 22:37 UTC
    I wouldn't reccomend doing that. It's bad manners to have a module installed in the standard installation directory with broken permissions. Any user would see the module is installed, but wouldn't be able to use it.

    What if somebody else writes a module that uses yours as a prerequisite? His installations would be broken. If you really want to use a module privately, you could tell the user to specify a PREFIX, although that doesn't always work.

    So I'd say it's almost assuredly a bad idea.

      you could tell the user to specify a PREFIX, although that doesn't always work
      i've read schwern's slides, but i always thought, perl Makefile.PL PREFIX=... LIB=... would work on all systems? so using
      perl Makefile.PL PREFIX=~/perl LIB=~/perl use lib "$ENV{HOME}/perl";
      doesn't work on some systems? (i'm using that for cgipan, so it would be interesting to know where that doesn't work)

      oops, s/slices/slides/, thanks Happy-the-monk =)

      Any user would see the module is installed, but wouldn't be able to use it.

      But that's the point.

        And what's preventing the user to install the module into his/her own directory? It's trivial if the module is Perl only and only slightly harder if it contains some compiled parts.

        Jenda
        XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.

        A reply falls below the community's threshold of quality. You may see it by logging in.