Posted on 2007-02-16 00:08:25-08 by tonyledford
Comments and Suggestions for Module

First, let me say that I like the idea of this module. I've always thought that perl lacked this one feature of being able to source in a new environment. We use a specialized environment generator (written in ksh) that sets tons of environment variables to control various aspects of the system (such as where data files are located, where backups should go, etc). I never really wanted to tackle the problem of having perl read in the environment this script generates - Shell::EnvImporter to the rescue!!

However, there are a some things I wanted to comment on as I've tried to use this module. The code is still new to me so I haven't really got any code to provide (I'd be happy to once I've read and understood this module's internals a little better) to enhance the module.

1. The test program should skip shell tests when a desired shell doesn't exist. The test program fails because I don't have bash on my system. I didn't see anywhere in the doc about controlling what tests get run; most modules figure this out for themselves.

2. The documentation should be more explicit about the differences between the 'file' and 'command' parameters to Shell::EnvImporter->new(). When using the 'command' option, the command that is run should print out it's environment settings (either explicitly or with its own env (or equivalent) command), otherwise when the command completes the environment changes are lost to the subsequent env command that the module automatically runs. I realize the example shows using ssh-agent and this program prints its env settings; I just thought the documentation didn't make that clear enough.

3. When using the 'file' or 'command' parameters to Shell::EnvImporter->new(), I would like to be able to give parameters to the 'file' or 'command' being run. I think this would involve a change to the Class::MethodMaker use statement, but I'm not sure (as I stated above I haven't had time to digest all this new code yet). This is not a critical error or issue since you can always create a file or command that figures out its parameters thru additional environment settings or whatever; it would just be a nice convenience.

Again, I'm glad this module is being distributed - this is my humble attempt to suggest some enhancements or improvements. As I play around with the code more, I'll try to send in my own enhancements to help in the development effort.

Thanks for your time.

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.