NikhilRangaraju has asked for the wisdom of the Perl Monks concerning the following question:

use Cvs; my $cvs = new Cvs ( cvsroot => ':pserver:nikhil@appollo:2401:/usr/local/cvs', password => 'nikhil' ) or die $Cvs::ERROR; $cvs->checkout('viewer'); my $status = $cvs->status('file'); if($status->is_modified) { $cvs->commit('file'); } $cvs->release({delete_after => 1}); $cvs->logout();
After that i opened command prompt and........
1) Perl Test.pl
2) No errors has come but........
3) Script is not functioning.....
4) please help me out to checkout files from server.......

Replies are listed 'Best First'.
Re: To perform Cvs Checkout from Cvs repository that is on server.
by Corion (Patriarch) on Feb 20, 2006 at 09:22 UTC

    You are not setting a working directory. I'm not sure how Cvs handles a missing working directory, but you should supply it when constructing the $cvs object:

    use strict; use Cvs; my $cvs = Cvs->new( './my_workdir', cvsroot => ':pserver:nikhil@appollo:2401:/usr/local/cvs', password => 'nikhil' ) or die $Cvs::ERROR;

    As the script doesn't output anything, but also doesn't tell you what went wrong, you need to add debugging output everywhere, to determine what goes wrong:

    print "CVSROOT is ", $cvs->cvsroot, "\n"; print "Workdir is ", $cvs->working_directory, "\n"; print "Error is ", $cvs->error, "\n"; print "The CVS knows the following modules:\n"; for my $module ($cvs->modules) { print "\t$module\n"; };

    You should also run your programs with the -w switch (like perl -w test.pl) so Perl can warn you about problematic code.