#!/usr/bin/perl -w use strict; =head1 NAME echoin =head1 DESCRIPTION Echos stdin to stdout and also pipes it to our own args, which are interpreted as a shell command. =cut # mkfifo /tmp/echoin$$ # tee /tmp/echoin$$ # $* < /tmp/echoin$$ my $args = join ' ', @ARGV; open OUT, "|$args" or die "Can't run $args: $!\n"; while () { print $_; print OUT $_; }