Hi there, Monks!
Is there a way of printing to the browser the CVS Version of a file? I am working with this code here, but it is not working well, the file is under CVS but it can display the file current CVS Version to the screen, any help?

#!/perl/bin/perl print "Content-type: text/html\n\n\n\n"; ### Get the name of the file being requested. #my $Temp = $ENV{'REQUEST_URI'}; my $Temp = "../dcheck.pl"; my $Cvs = $Temp; ### Split the url by "/". my (@Junk) = split(/\//, $Cvs); ### Get the end of the url, which is the filename. my $File = pop @Junk; $Cvs =~ s/[^\/]+$//g; ### Attach the document root directory so we get the complete path t +o the ### file on our computer server. Also, attach the CVS/Entries name s +o that ### we get the CVS information. $Cvs = $ENV{'DOCUMENT_ROOT'} . $Cvs . "CVS/Entries"; ### Open the file, and if we find a match, record it to $Match my $Match = ""; open(FILE,$Cvs); while (my $Line = <FILE>) { if ($Line =~ /$File/) {$Match = $Line; chomp $Line} } close FILE; ### If match is not found, print not found, otherwise get the infor +mation. if ($Match eq "") {print "No CVS information found. '$File'\n";} else { ### Get the information we want and print it out. my ($Junk,$File,$Version,$Date,@Junk) = split(/\//, $Match); print "Version <b>$Version</b> : Date Last Changed <b>$Date</b>\n"; }


Thank you all!

In reply to CVS Version of a File by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.