Help for this page

Select Code to Download


  1. or download this
      #foo() is the sub that outputs a lot of data
      my $pid = open(SUBOUT, '-|');
    ...
        $|=1; foo(); exit(0);
      }
      while (<SUBOUT>) ...
    
  2. or download this
    #!/usr/bin/perl -l
    defined($tmp = open(FOO, '-|')) or die "Can't fork: $!";
    ...
    }
    
    print for map {chomp; "[$tmp] {$_}"} <FOO>;
    
  3. or download this
    $"=$,,$_=q>|\p4<6 8p<M/_|<('=>
    .q>.<4-KI<l|2$<6%s!<qn#F<>;$,
    .=pack'N*',"@{[unpack'C*',$_]
    }"for split/</;$_=$,,y[A-Z a-z]
             {}cd;print lc