Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Installation script

by andreychek (Parson)
on Jun 08, 2001 at 17:18 UTC ( #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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://86892]
[shmem]: Discipulus: the <<>> operator is quite new, it is in perl5.24 for instance
[Discipulus]: ah! thanks shmem it works in strawberry 5.24
[shmem]: ah. Introduced in 5.22.0, see perl5220delta
[Discipulus]: if so the previous error is a bit misleading, anyway
[shmem]: well, previous to that << was always treated as the left-shift operator
[Eily]: or the here-doc operator
[Eily]: which is actually how it is parsed in this case
[shmem]: older versions of perl can't guess that "use of <<>> may be implemented someday" :D
Discipulus how much wise my brothers are? ;=)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-07-21 09:07 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (320 votes). Check out past polls.