my $cobin = "/usr/local/bin/co"; my $enscript = "/usr/local/bin/enscript"; my $cvs_repos = "/path/to/cvs/repository"; my $rev = "1.1" my $file = "script.pl"; open(CVS, "$cobin -r$rev -p $cvs_repos/$file 2>&1 |"); @code = ; # write it to a temp file so enscript can use it open(TMPCVS, ">/tmp/tmpcvs.$$"); foreach (@code) { print TMPCVS $_; } close(CVS, TMPCVS); # the 2>/dev/null drops all stderr text, which is usually "output left in -". This would have ended up either in the code # or the log file. open(ENSCRIPT, "$enscript --pretty-print=perl -G --language=html --color -p- /tmp/tmpcvs.$$ 2>/dev/null |"); my @source = ; close(ENSCRIPT); unlink("/tmp/tmpcvs.$$");