Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. my $prepend = 'foo foo foo';
  2. my $contents = `command`;
  3. open(my $handle, "|-", "command_2"))
  4. print $handle $prepend . $contents;
  5. close $handle;
  6.  
  7. my $prepend = 'foo foo foo';
  8. open(my $handle_in, "-|", "command"))
  9. open(my $handle_out, "|-", "command_2"))
  10. print $handle_out $prepend;
  11. while (<$handle_in>) {
  12. print $handle_out $_;
  13. }
  14. close $handle_in;
  15. close $handle_out;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement