in reply to Saving Standard Output (overloading print())

I think I remember something like this in the Camel...
#!/usr/bin/perl use strict; my $logfile = $ARGV[0]; open STDOUT, "|-" or do { open LOG, ">> $logfile" or die "Unable to open $logfile: $!\n"; while (<STDIN>) { print, print LOG } close LOG, close STDOUT; exit; }; print "This is only a test.\n";
I'm sure it is much more elegant in the book... check the IPC chapter. :)

-faure