tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:
I would like to have something like
force install ('SQL::Translator');
ornotest install ('SQL::Translator') or die "died on SQL::Translator"; but that doesn't work from the programming interface, the way it does from the shell. The only method that seems to work from within the API is install ('SQL::Translator')
I suppose I could do system("perl -MCPAN -e 'force install SQL::Translator'"); over and over, or just code the whole thing up in bash, but that seems to be going against the whole spirit of why CPAN was created in the first place.
I guess the deeper issue is that I don't really understand what force/notest exactly are. They're described in the CPAN doc as pragmas, but I don't get it. They seem not to be pragmas in the sense of "strict/warning" which are just modules. That is to say, you can search for strict/warnings modules on CPAN, but not the "force" module. So I guess the meaning of pragma is different here.
What's the underlying model here? What's the connection between the CPAN api methods and commands like "force" and "install" which can be issued from the shell?
By the way, this question applies to CPANPLUS as well as CPAN. Lately I've been switching back and forth between the two, as sometimes the install is easier within one, other times the other.
2006-08-23 Retitled by holli, as per Monastery guidelines
Original title: 'force install from within a script? In what sense are force/install pragmas? (What's the connection between the CPAN programming methods to what happens in the CPAN shell?)'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: What's the connection between the CPAN programming methods to what happens in the CPAN shell?
by xdg (Monsignor) on Aug 23, 2006 at 11:19 UTC | |
Re: force install from within a script?
by shmem (Chancellor) on Aug 23, 2006 at 10:54 UTC |