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

I've written a small daemon using Net::Daemon to run on my company's server. Unfortunately, after writing and testing the code on my box, I was told that, for paranoia's sake, we could not install the Net::Daemon package on the server (or any other perl module, for that matter). So, it seems to me that this is a somewhat silly attitude, but it's one I have to deal with. Any suggestions for how to rewrite my code without the use of any perl modules, or perhaps any way to install the perl module without actually installing it (heh, if that makes sense - like cut all the documentation stuff out of it, throw it in the directory my script resides in, and use require instead of use)?
Any help would be greatly appreciated, thanks!

Replies are listed 'Best First'.
Re: Net::Daemon without Net::Daemon
by Russ (Deacon) on Jun 23, 2000 at 04:26 UTC
    It looks like Net::Daemon uses only Perl code (nothing compiled), but depends on many other modules. I have once included a module (having no control over the client's server) rather than force its installation. By what I see, you could do that, here. Put the .pm file in your source, include the other modules it needs (in the correct directories) and use it.

    Or, pull the code you need out of the modules and use it in your own files. Be careful not to violate license restrictions (Net::Daemon is released as GPL or Artistic License), and give proper credit to the author(s).

    Of course, this doesn't address the "I've been forbidden to do it, but I will anyway" dilemma. ;-)

    Russ

Re: Net::Daemon without Net::Daemon
by davorg (Chancellor) on Jun 23, 2000 at 12:49 UTC

    I've come a across this attitude in a couple of places. My usual tactic is to point out that either I can use the module which has been installed and tested on thousands of servers over the last few years, or I can try to write my own code to reproduce the functionality in the module in my own code. Of course I point out that I can't guarantee that my own code will be a safe and efficient as the CPAN module.

    Plan B would be to find a new job with less idiots in the sysadmin group :-)

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000
    <http://www.yapc.org/Europe/>
Re: Net::Daemon without Net::Daemon
by Aighearach (Initiate) on Jun 23, 2000 at 05:02 UTC
    Yes, you should be able to just throw it, and any modules it relies on, into the same directory as your script. Then, just use lib qw( . );

    Usually, when they won't install the modules is it because they think there is somehow more of a security risk in installing the modules "on the server" than there is in letting you run your scripts on the server in the first place. These types of morons^H^H^H^H^H^Hpeople usually won't notice that you have "installed" modules into your project. But if you're paranoid about it, just strip out everything but the code, and say it is part of your project.

    Paris Sinclair    |    4a75737420416e6f74686572
    pariss@efn.org    |    205065726c204861636b6572
    I wear my Geek Code on my finger.
    
Re: Net::Daemon without Net::Daemon
by maloi (Acolyte) on Jun 29, 2000 at 02:37 UTC
    Happy ending! After a wee bit of talking, the powers-that-be decided it would be harmless to install the module afterall, so now it's installed and my script is able to run without modification. Whoo!