#!/usr/bin/perl -w

use CGI;
use strict;

############### Globals ###############
my $ciggy = new CGI;
my $file     = $ciggy->param ("file") || "cvs2cl.pl";
my $revision = $ciggy->param ("revision");
my $tmpfile  = "/tmp/get-rev.$$.tmp";

############### Code ##################

print "Content-type: text/plain\n\n";
system ("cvs up -p -r ${revision} ${file} > ${tmpfile}");
open (TMP_COPY, "<${tmpfile}") 
    or die "trouble opening ${tmpfile} for reading ($!)";
print while (<TMP_COPY>);
close (TMP_COPY);
unlink (${tmpfile});
