in reply to Thank you for the thoughts
in thread How do I detect what modules are not being used?

Take a look at PAR, they are solving a similar problem (OTOH, when you say 'use STH' they just assume it's because you need it), but still, they had a problem of figuring out which modules a given script might need, but still the problem is similar.

OTOH, PAR might solve your problem of ensuring that given script will run on another machine - you can either pack your script, together with all it's requirements into .par archive, or even pack it into elf executable ( but that tends to create 2-5 megabyte executables ).