I have a Perl script that is trying to run a ClearCase script called "cleartool find" The issue is that is needs to be ran in a /../vob directory and not sure how to get the script to run in that directory.
#!/usr/bin/env perl
use warnings;
use strict;
use Cwd;
sub main() {
stat("ls l-tr");
my %files;
chdir ("/view/conflictcheck.view1/vobs/app_bos") or die "canno
+t change: $!\n";
print(cwd);
while (<>) {
my ($branch, $count);
chomp;
$branch = $_;
next if !$branch;
print "Scanning $branch\n";
open(FILES, "cleartool find . -nxn -ele \"version(/mai
+n/$branch/LATEST)\" -print |");
while (<FILES>) {
chomp;
push @{$files{$_}}, $branch;
$count++;
}
close(FILES);
if (!$count) {
print "WARNING: $branch does not contain any files.\
+n"
}
}
print "Calculating conflicts\n";
foreach my $file (keys %files) {
my $len = @{$files{$file}};
next unless ($len > 1) && (-f $file);
print "$file\n";
for (my $i = 0; $i < $len; $i++) {
print " $files{$file}[$i]\n";
}
}
}