Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $prepend = 'foo foo foo';
- my $contents = `command`;
- open(my $handle, "|-", "command_2"))
- print $handle $prepend . $contents;
- close $handle;
- my $prepend = 'foo foo foo';
- open(my $handle_in, "-|", "command"))
- open(my $handle_out, "|-", "command_2"))
- print $handle_out $prepend;
- while (<$handle_in>) {
- print $handle_out $_;
- }
- close $handle_in;
- close $handle_out;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement