On Tue, 24 Apr 2007, Sherm Pendley wrote:

On Apr 24, 2007, at 11:39 PM, [EMAIL PROTECTED] wrote:

Is there a way to pre-compile a script to figure out what modules it may need so I can download them and store them in a cached lib directory?

Add code that prints %INC upon exiting, then run the script - that'll give you a list of every file that was use()d or require()d during the script's run.

I need to dynamically download both the script AND any modules the script may require. This means I need to dynamically download the script itself, then just before running the script, figure out what modules are required and download them as well.

To say it another way, I don't know the name of the script (or any modules it may need) before it's requested.

The client app I intend to write will be written in C and include an embedded perl interpreter. The user will run the client (again written in C)... and issue a command. This command will run on the server, but it MAY include a client-side component written in perl. The C app will send a message to the server to see if there's a client-side perl component and if so, download the perl script.

It's at this point I'd like to be able to somehow detect (without actually running the script) what modules it may need, so I can download them.

Another possible alternative would be to somehow interject some code into the perl interpreter just before it attempts to look for an external file (ie searches %INC).... assuming that's even possible.

Reply via email to