I know it's easy to install a module with 'force' using CPAN from command prompt. I am trying to achieve same through the script:
use CPAN;
eval "use Filesys::DiskSpace" or do {
    CPAN::install("Filesys::DiskSpace");
};
Is there any way to add the option 'force' to the code? I am having the following error while compiling the module:
  make test had returned bad status, won't install without force
The warnings could not be serious, so I would like to proceed with the installation. Thanks.
Looks like you'll need to instantiate CPAN to a variable and call the force() method on it
my $cpan = CPAN->new;
$cpan->force();
$cpan->install("Filesys::DiskSpace");
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With