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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:37:01+00:00 2026-06-12T09:37:01+00:00

Hi I have this problem where the perl script spits back No child process

  • 0

Hi I have this problem where the perl script spits back “No child process found at” …

My script calls several different types of forks, so I tried implementing the perldoc’s waitpid() implementation method to be able to use handle both fork & exec & system & qw.

 $SIG{CHLD} = sub {
    # don't change $! and $? outside handler
    local ($!, $?);
    my $pid = waitpid(-1, WNOHANG) > 0;
    return if $pid == -1;
    return unless defined $children{$pid};
    delete $children{$pid};
};

    my $pid = fork();
    die "cannot fork" unless defined $pid;
    if ($pid == 0) {
        # ...
        exit 0;
    } else {
        $children{$pid}=1;
        # ...
        exec($command);
   }

There is no problem with this part of the execution of the code, however the “No child processor found” occurs when I try to close the filehandle’s CLOSE. Can someone explain to me how come this is happening, as I really want to understand this problem more in depth. Do I end up reaping the child process forked by the OPEN call, so that the close doesn’t know how to handle the file handle? or maybe I’m 100% off. Any solutions would be appreciated

open(RESULTS, "-|", "find $dir\/ -maxdepth 1 -name RESULTS -print0 | xargs -0 cat ") or die $!;
while(<RESULTS>){
if($_ =~ /match/){
    print $_;
 }
  }
 close RESULTS;
  • 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-12T09:37:06+00:00Added an answer on June 12, 2026 at 9:37 am

    close on a handle* opened thusly calls waitpid to reap the child created by open. However, your signal handler managed to reap the child before close did, so close could not find the child, so close returned an error.

    You could fix this by changing your signal handler to only reap the children you’ve created using fork (below), or you could ignore that error from close.

    $SIG{CHLD} = sub {
       local ($!, $?, $^E);
       for my $pid (keys(%children)) {
          if (waitpid($pid, WNOHANG) > 0) {
             delete $children{$pid};
          }
       }
    };
    

    * — The proper term is “file handle“. It is named such since it allows you to hold onto a file. It’s not handler as it performs no action.

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

Sidebar

Related Questions

please help! I'm really going nuts with this problem! I have a CGI perl
I am generating new xml file using perl script but I have small problem,
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets
This problem is really puzzling to me: I have the following script working on
I found this perl script here which seems will work for my purposes. It
Sorry, if this to verbose, but I have a perl script that is partly
I have this Perl script with many defined constants of configuration files. For example:
In a quick-and-dirty Perl script, I have a data structure like this: $tax_revenue{YEAR}{STATE}{GOVLEV}{TAX} =
I have a perl script which calls fork() a few times to create 4
I have a perl script using CGI. The browser calls it with some parameters.

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.