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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:45:06+00:00 2026-06-15T15:45:06+00:00

I have a PERL script that loops through and calls a binary with a

  • 0

I have a PERL script that loops through and calls a binary with a different argument. I am using IPC::Run. I would like when the user presses a key such as “ENTER” a status message is displayed such as

“Currently working on 14 of 28 total scripts (50% complete)”

My script is as follows:

    foreach my $file (@files) {

        $file =~ s/$file_dir//;

        #Run the test case, store the output in $stdout 
        run [ "php", "PROGRAM.phar", "$file" ], ">", \my $stdout;

                    print LOG_FILE "Return code $?\n";
                    print LOG_FILE "Output: $stdout");

    }

Basically how would I interrupt the binary in order to display my status message?

  • 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-15T15:45:08+00:00Added an answer on June 15, 2026 at 3:45 pm

    If I correct this usage of IPC::Run is not multithreaded. It will execute the commands one by one and it is not possible to print messages because there is only one process.

    Like:

      use Parallel::ForkManager;
    
      $pm = new Parallel::ForkManager($MAX_PROCESSES);
      my $input;
    
      foreach $data (@all_data) {
        # Forks and returns the pid for the child:
        my $pid = $pm->start and next;
    
        ... do some work with $data in the child process ...
    
        $pm->finish; # Terminates the child process
        chomp($input= <STDIN>);
        print "Some statistics\n" if $input =~ m!\n!;
    
      }
    

    Regards,

    • 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 calls an other perl script by using system()
I have a perl script that's reading an INI file like this: [placeholder_title] Hostname
I'm currently using a cron job to have a perl script that tells my
I have a lot of Perl scripts that looks something like the following. What
I have a Perl script that takes user input and creates another script that
I have a Perl script that uses WWW::Mechanize to read from a file and
I have a Perl script that takes text values from a MySQL table and
I have a Perl script that launches 2 threads,one for each processor. I need
I have a Perl script that requires a couple of plugins, for istance nmap.
I have a Perl script that will execute three applications. All of it have

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.