Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    use strict;
    
  2. or download this
    my @kids = (
        sub { print "First!",  $/; },
        sub { print "Second!", $/; },
    ...
    );
    
    pipe my ($in, $out);
    
  3. or download this
    my %kid;
    for (@kids) {
        my $cpid = fork;
    ...
        };
        $kid{$cpid} = undef;
    }
    
  4. or download this
    close $out or warn $!;
    s/.$/??? says the child/, print while <$in>;
    delete $kid{+wait} while %kid;