beebware has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a command line script that will need to be able to be run on a wide variety of machines (Win,Linux,Solaris,Mac etc) whose Perl installations date back around 2 years. I can't upgrade Perl on the machines, nor can I install new modules onto them (various technical reasons). So my question is this: What can my script "assume" has been installed? Is IO::Socket a 'standard module' that comes with every Perl installation and doesn't need additional installing, can Net::SMTP be relied on to "always be there"?. Is there a standard "minimal installation" list of modules etc that I can cross-reference to check my script will run on all possibilities without additional module installation?
Re: What is a 'base installation'
by Ovid (Cardinal) on Apr 21, 2002 at 22:45 UTC
|
Just check the standard module list. You can also check the MANIFEST, though that includes everything that ships with Perl and not just the modules. I went ahead and assumed 5.005 as the version, since your version is a couple of years old, but you can check http://perldoc.com/ for your particular version.
Another thing you can do is run a minimum install of Perl at the lowest version level you're likely to support and do all development on that box, if possible. Not only will that limit you to standard modules, you won't accidentally try to use our or other features that your Perl won't support.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
| [reply] |
|
Many thanks for the link to the Manifest - I totally forgot about that! Is there a site where I can download various "old" installations of Perl for various platforms?
| [reply] |
|
| [reply] |
Re: What is a 'base installation'
by mojotoad (Monsignor) on Apr 22, 2002 at 01:20 UTC
|
Is it feasible to a) have the script rely on its own set of required modules or b) rely on it's own perl installation?
Many times I've had to ensure that a perl script will run even on machines where there is no perl installation. (I say "script" but really we're talking about an application suite here). So I compiled versions of perl for every known target OS and architecture and relied on a <ugh> sh wrapper for launch via a soft link.
That last is a lot of effort, generally not worth it for a single script. However if your machines share any file systems, it's worth considering perl from a depot.
I think I'd hone in on a core set of modules. For any that are "absent must-have's" then distribute your own version of the module along with the script.
Just remember that a little Perl is far better than no Perl.
Matt
| [reply] |
Re: What is a 'base installation'
by samtregar (Abbot) on Apr 22, 2002 at 00:23 UTC
|
I've got bad news: you'll have to test to find out. You need to assemble an instance of every platform you intend to support. Just finding out what was in the Perl source distribution for a given release won't be enough - everyone that packages Perl puts a little extra in and skims off a little fat.
I've been working on an installation system for Bricolage and I've been using VMWare to setup test boxes. It's been a great help but it's still a lot of work.
-sam | [reply] |
Re: What is a 'base installation'
by dws (Chancellor) on Apr 21, 2002 at 22:37 UTC
|
Is there a standard "minimal installation" list of modules etc that I can cross-reference to check my script will run on all possibilities without additional module installation?
I don't know if there's anything official, but if you get your hands on a 5.005 ActiveState distribution, you'll probably be doing O.K. (It didn't have Net::SMTP.)
| [reply] |
Re: What is a 'base installation'
by DigitalKitty (Parson) on Apr 22, 2002 at 14:23 UTC
|
Hi.
The 'vanilla' modules are fairly numerous but you could check for a specfic module by using the following one-liner:
C:\>perl -e "use Tk"
Can't locate Tk.pm in @INC (@INC contains: C:/Perl/lib/MSWin32-x86-mul
+ti-thread
C:/Perl/lib C:/Perl/site/lib .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
This informs me that I haven't installed the Tk module ( not yet at least ). If you ran that command ( or better still, put it into an array and interated over it ), you would see if it's available or not. I think japhy wrote a script to find all the installed modules on a machine.
Hope this helps.
-DK
| [reply] [d/l] |
|
|