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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:52:19+00:00 2026-05-12T12:52:19+00:00

I would like to call other Perl scripts in order to perform a contention

  • 0

I would like to call other Perl scripts in order to perform a contention test from with a main Perl script.

Something like this currently works:

system("perl 1.pl");
system("perl 2.pl");
exit;

However, I would like to kick these off as independent threads running at the same time.

I tried, based on my Google searches, doing something like this:

system(1, "perl 1.pl");
system(1, "perl 2.pl");
exit;

That doesn’t work. The main script exists immediately, which is fine, but the underlying threads I want to spawn don’t get kicked off. I was wondering if there was something else I have to do or if anyone else has done something like this.

Thanks for any help in advance.

  • 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-12T12:52:20+00:00Added an answer on May 12, 2026 at 12:52 pm
    use threads;
    $thr1 = threads->create('msc', 'perl 1.pl');
    $thr2 = threads->create('msc', 'perl 2.pl');
    
    $thr1->join();
    $thr2->join();
    
    sub msc{ ## make system call
      system( @_ );
    }
    

    This will wait for both to finish executing before the it will exit. I’m guessing this is what you want from your original question, right? If not feel free to drop a comment and edit your post to explain it better, and I’ll try again.

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

Sidebar

Related Questions

I have a java SAX parser which I would like to call multiple times
I would like to do the following, but I'm not sure I'm using the
I wrote a simple server in C and would like to have the same
I have 2 sub s in my perl code that are all but identical.
I am writing an command line application in C and from within the program,
What type of pattern would you recommend for a multiple input, single output situation.
long shot: is it possible to get the name of a calling function or
I have a question about remote threads.I've read Mike Stall's article present here: <
Currently I am using the below code to start my application (which is working)
I've had a similar question but the answer did not entirely fix my problem.

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.