Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:59:42+00:00 2026-05-25T23:59:42+00:00

I have a Perl script that has two dependencies that exist in CPAN. What

  • 0

I have a Perl script that has two dependencies that exist in CPAN. What I’d like to do is have the script itself prompt the user to install the necessary dependencies so the script will run properly. If the user needs to enter in some kind of authentication to install the dependencies that’s fine: what I’m trying to avoid is the following workflow:

Run script -> Watch it fail -> Scour CPAN aimlessly -> Lynch the script writer

Instead I’m hoping for something like:

Run script -> Auto-download script dependencies (authenticating as necessary) -> Script succeeds -> Buy the script writer a beer

Can this be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:59:43+00:00Added an answer on May 25, 2026 at 11:59 pm

    Each of the standard build paradigms has their own way of specifying dependencies. In all of these cases, the build process will attempt to install your dependencies, automatically in some contexts.

    In ExtUtils::MakeMaker, you pass a hash reference in the PREREQ_PM field to WriteMakefile:

    # Makefile.PL for My::Module
    use ExtUtils::MakeMaker;
    
    WriteMakefile (
        NAME => 'My::Module',
        AUTHOR => ...,
        ...,
        PREREQ_PM => {
            'Some::Dependency' => 0,             # any version
            'Some::Other::Dependency' => 0.42,   # at least version 0.42
            ...
        },
        ...
     );
    

    In Module::Build, you pass a hashref to the build_requires field:

    # Build.PL
    use Module::Build;
    ...
    my $builderclass = Module::Build->subclass( ... customizations ... );
    my $builder = $builderclass->new(
        module_name => 'My::Module',
        ...,
        build_requires => {
            'Some::Dependency' => 0,
            'Some::Other::Dependency' => 0.42,
        },
        ...
    );
    $builderclass->create_build_script();
    

    In Module::Install, you execute one or more requires commands before calling the command to write the Makefile:

    # Makefile.PL
    use inc::Module::Install;
    ...
    requires 'Some::Dependency' => 0;
    requires 'Some::Other::Dependency' => 0.42;
    test_requires 'Test::More' => 0.89;
    ...
    WriteAll;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Perl script that I'd like to run on Windows, using either
I have a Perl script that has (skipping many irrelevant lines) use HTML::Entities; my
I have a Perl script that I'm attempting to set up using Perl Threads
I have a Perl script that sets up variables near the top for directories
I have a Perl script that pops up a message box when its work
I have an existing Perl script that uses the FTP object to send a
I have a little Perl script (On Windows) that checks some files for me
G'day, We have a Perl script that is processing geolocation requests from the head-end
I have a Perl script that runs a different utility (called Radmind , for
I have a perl script that will perform some operations on directories, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.