Jonathan Rockway <[EMAIL PROTECTED]> writes: > There are plenty of things that install and run apps on the CPAN. > App::Ack comes to mind. It Just Works, there is nothing special you > need to do.
App::Ack (and all the other scripts that 'just work') require everything to be installed in the standard Perl location. If your modules are in @INC, everything just works. What Austin tries to do it to build an app that can be installed as an app, not as a Perl module. And then it is suddenly not as easy anymore. There's no support from EU::MM and M::B for installing apps. Applications are conventionally (and conveniently) placed in /usr/bin or /usr/local/bin. On *nix systems, that is. Other systems often have less strong conventions, or more difficult ones. Basically, there are two problems. First is, how can the app script find its modules. For the most trivial cases, FindBin can solve this. Note that it is wrong to assumpe that modules can (and will) always be stored in the standard @INC. The app's modules are not for general use. The app may include modules that potentially conflict with installed modules, and so on. So the app's modules must be installed in a location that does not interfere with others. Second, and structurally underestimated problem is, how can the app find its data. Yes, apps can have data. Default settings, images, icons, helpers, and so on. The most correct solution for both problems (IMNSHO) is to have the installer put modules and data in a suitable place, and locally prepend this to @INC. This would require the installer (which is the only one who knows where the app will get installed) to insert or modify a suitable 'use lib' in the app script(s). It can fix the #!, so why not fix this as well? But again, there is no easy and straightforward support for this from EU::MM and M::B. > Perhaps you are worrying a problem that doesn't exists? No, it is a very real problem. -- Johan