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

  • SEARCH
  • Home
  • 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 7444407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:30:16+00:00 2026-05-29T11:30:16+00:00

I have made a script to intimate the admin the list of module need

  • 0

I have made a script to intimate the admin the list of module need to be installed on machine .

I am trying to check wheather the module installed by underbelow code. The odd thing is that it is showing even installed module in the machine as not installed

    #!/usr/bin/perl -w
    my @module_list =('Smart::Comments','HTML::Parse');
    foreach (@module_list) {
      eval { require "$_" };
      if (!($@)) {
        print "Module Not installed : $_\n";
      }
    }
  • 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-29T11:30:17+00:00Added an answer on May 29, 2026 at 11:30 am

    You need to use the string form of eval because require needs a bareword argument to match against the double-colon-separated form of the module name (e.g. Scalar::Util). (If it’s not a bareword, then it needs to be a relative path, e.g. 'Scalar/Util.pm')

    #!/usr/bin/perl
    
    use strict;
    use warnings;
    
    my @module_list = ('Scalar::Util', 'flibble');
    
    foreach (@module_list) {
        if (!eval "require $_") {
            print "Module not installed: $_\n";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi, I have made this simple script but I need to have it check
I have a Test::More test script for a module we have made. When running
I have made a subdomain and uploaded php script on that. but php code
I have made this code(it is a part of my whole script) -- if(unset($_SESSION['USER_ID']))
I am trying to implement the jquery selectbox script. I have made all the
I have made this script to open a fancybox from code behind, but it
I have made a simple webpage to check for regular expressions. <html> <head> <script
Ok, i have made a contact form. i need a php script to email
So I have a validation script I made a while ago. I can pass
I have made some code which exports some details of a journal article to

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.