Help for this page

Select Code to Download


  1. or download this
    open my $fh, '<', '/dev/zero' or die "$!";
    
  2. or download this
    pipe my ($header_in, $header_out);
    pipe my ($body_in, $body_out);
    
  3. or download this
    use Fatal qw( close );
    
    close STDIN;
    close STDOUT;
    pipe my ($message_in, $message_out);
    
  4. or download this
    #!/usr/bin/perl
    use strict;
    ...
    header_out has descriptor 5
    body_in has descriptor 6
    body_out has descriptor 7
    
  5. or download this
       while (1) {
          open my $fh, '<', '/dev/zero' or die "open(): $!";
    ...
          die "file descriptor $n not available" if fileno($fh) > $n;
          push @fakes, $fh;
       } ## end while (1)