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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:08:18+00:00 2026-06-05T18:08:18+00:00

I have a huge java codebase (more than 10,000 java classes) that makes extensive

  • 0

I have a huge java codebase (more than 10,000 java classes) that makes extensive use of CORBA (no documentation available on its usage though).

As first step to figure out the CORBA usage, I decided to scan entire codebase and extract/print unique lines which contain the pattern “org.omg.CORBA“. These are usually in the import statements (e.g. import org.omg.CORBA.x.y.z).

I am newbie to Perl and want to know if there is a way I can extract these details on Windows OS. I need to be able to scan all folders (and sub-folders) that have java classes.

  • 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-06-05T18:08:20+00:00Added an answer on June 5, 2026 at 6:08 pm

    You can use File::Find in a one-liner:

    perl -MFile::Find -lwe "
        find(sub { if (-f && /\.java$/) { push @ARGV,$File::Find::name } },'.'); 
        while(<>) { /org.omg.CORBA/ && $seen{$_}++; }; 
        print for keys %seen;"
    

    Note that this one-liner is using the double quotes required for Windows.

    This will search the current directory recursively for files with extension .java and add them to the @ARGV array. Then we use the diamond operator to open the files and search for the string org.omg.CORBA, and if it is found, that line is added as a key to the %seen hash, which will effectively remove duplicates. The last statement prints out all the unique keys in the hash.

    In script form it looks like this:

    use strict;
    use warnings;
    use File::Find;
    
    find(sub { if (-f && /\.java$/) { push @ARGV,$File::Find::name } },'.');
    my %seen;
    while(<>) {
        /org.omg.CORBA/ && $seen{$_}++; 
    }
    print "$_\n" for keys %seen;"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is, we have a huge number of records (more than a million)
I have a huge Java Application with numerous packages. Some of the classes in
I have this java simulator that will need to handle a huge amount of
I have a Java program that makes a request to a web service that
We have huge codebase and some classes are often used via reflection all over
We have a huge java application that entirely works based on JAXB serialization.The middleware
I have a huge IQueryable that I want to export directly to Excel for
i have a huge sql query that is attached to the rowsource of a
i have a huge .java file and i want to find all declared objects
I have two questions - I'm a beginner in Java but have a huge

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.