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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:31:31+00:00 2026-05-17T20:31:31+00:00

I am trying to open multiple processes in a Perl script on Windows. Program

  • 0

I am trying to open multiple processes in a Perl script on Windows. Program structure would look some thing like this…

 my($chld1_out, $chld1_in);
   my($chld2_out, $chld2_in);
   my($chld3_out, $chld3_in);
   my @cmds1=();
   my @cmds2=();
   my @cmds3=();

    $pid1 = open2($chld1_out, $chld1_in, 'ex1.exe')or die $!;
    $pid2 = open2($chld2_out, $chld2_in, 'ex2.pl')or die $!;
    $pid3 = open2($chld3_out, $chld3_in, 'ex3.exe')or die $!;

   print $chld1_in $cmds1[0];
   print $chld2_in $cmds2[0];
   $op1=<$chld1_out>;
   $op2=<$chld2_out>;
   if ( $op1 == 'done' && $op1 != 'done')
   print $chld1_in $cmds1[0];
   elsif ( $op1 != 'done' && $op1 == 'done')
   print $chld2_in $cmds2[0];
   elsif ( $op1 == 'done' && $op1 == 'done')
   print $chld1_in $cmds1[1];
   print $chld2_in $cmds2[1];
   .....
   .....
   for loops and while loops..... to process with the data output... and do conditional programming. 
   close $pid1 or die $!;
    close $pid2 or die $!;
    close $pid3 or die $!;

If it does how can I execute the Perl script ( ex2.pl )
one way i know is
system($^X,”ex2.pl”,”arg”) ;

I would appreciate fro your help on this ASAP…

Thanks,

-Abishek

  • 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-17T20:31:32+00:00Added an answer on May 17, 2026 at 8:31 pm

    Probably not, “opening” a process for reading is usually a fork and a pipe behind the scenes. And fork-execs don’t work on Windows*.

    For executing a Perl script, just do it.

    do 'ex2.pl';
    

    And if you want to pass args:

    {   local @ARGV = qw<One Two Three>;
        do 'ex2.pl';
    }
    

    When ex2.pl wants to access @ARGV it will be ( 'One', 'Two', 'Three' ). Of course if you want to do any of the perl shorthand ARGV tricks, it’s better to localize the GLOB.

    { local *ARGV = [ qw<One Two Three> ]; ... }
    

    * – I’ve long thought that a suitable workaround should be possible using Windows process structures which have a readable stdout and stderr, as a well as a writable stdin.

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

Sidebar

Related Questions

I'm trying to open a Microsoft Excel file in a C# program using the
I got this error today when trying to open a Visual Studio 2008 project
All of a sudden I start getting this error while trying to open 2
Here's some background on what I'm trying to do: Open a serial port from
I'm trying to open multiple files simultaneously (random number of files) and store their
I have an odd issue happening when trying to open multiple Input Streams (in
I'm trying to set up multiple dialogs in the same page, trying to open
im trying to open a file using StreamReader and ive to set a Encoding,
I'm trying to open a folder in explorer with a file selected. The following
I'm trying to open a file and create a list with each line read

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.