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 847337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:46:02+00:00 2026-05-15T06:46:02+00:00

I have a directory structure that looks like: Foo::Bar::Baz::1 Foo::Bar::Baz::2 etc Can I list

  • 0

I have a directory structure that looks like:

Foo::Bar::Baz::1
Foo::Bar::Baz::2 etc

Can I list the packages from something like:

use Foo::Bar::Baz;

Thanks!

Edit: Made it more clear what the modules are.

  • 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-15T06:46:03+00:00Added an answer on May 15, 2026 at 6:46 am

    Just to be clear, are you looking at random packages in random Perl code?

    Or for Perl modules, e.g. “a/b/c/d1.pm” with module “a::b::c::d1”?

    In either case, you can not use a single “use” statement to load them all.

    What you need to do is to find all the appropriate files, using either glob or File::Find.

    In the first case (modules), you can then load them either by require-ing each file, OR by converting filename into module name (s#/#::#g; s#\.pm$##;) and calling use on each module individually.

    As far as actual packages nested in random Perl files, those packages can be:

    • Listed by grepping each file (again, found via glob or File::Find) for /^package (.*);/

    • Actually loaded by executing require $file for each file.

      In this case, please note that the package name for each of those packages in a/b/c/1.pl will NOT need to be related to “a::b::c” – e.g. they CAN be named by the file author “p1”, “a::p1” or “a::b::c::p1_something”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project with a directory structure that looks like: /foo/baz/__init__.py /bar/foo.py /bar/splat.py
So, I have an app/assets/stylesheets/ directory structure that looks something like this: |-dialogs |-mixins
I have a directory structure that looks like this: project/ __init__.py foo/ __init.py__ first.py
I have a data model for a directory type structure that looks something like
I have a directory structure that looks like this: /a/f.xml /b/f.xml /c/f.xml /d/f.xml What
I have a directory structure that looks like this: basedir/dir1/dir2/dir3/dir4/myzip/subdirs I would like to
I have the original images in a directory structure that looks like this: ./Alabama/1.jpg
I have a directory structure something like this: base subdir1 subdir2 subdir3 subsubdir1 subsubdir2
Here are the details of my problem: I have a directory structure that looks
I have worked on maven projects in which the directory structure looks like: src/

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.