Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Installation script

by andreychek (Parson)
on Jun 08, 2001 at 17:18 UTC ( [id://86892]=note: print w/replies, xml ) Need Help??


in reply to Installation script

As much criticism as it often gets, I personally have found the
Slash code to be a good example, particularly in this area.

Slashcode has to download required modules, create directories,
modify permissions, creates DB tables, and I believe it may even change a config script somewhere,
but don't quote me on that.

In the root directory of the distribution, they have a typical
Makefile that you might see in say, a C program. It begins copying some
files into place, modifying permissions, and that sort of thing.
But then it recurses through all the Perl directories, and runs the Makefile.PL
files in those directories, which each use ExtUtils::MakeMaker.

I don't remember how slash does it, but MakeMaker is often what is used to
create dependencies for your application. If it doesn't do what
you need, you can also use the CPAN module and just do something like:
use CPAN; my @required_modules = qw(CGI XML::Parser HTML::Template); foreach my $module ( @required_modules ) { print "Checking for $module"; eval "require $module"; if($@) { print "failed\n"; print "$module does not seem to be present! I'll install it now +.\n"; CPAN::Shell->install($module); } }
You can just put those lines in your Makefile.PL. HTH
-Eric

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://86892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found