czach12345 has asked for the wisdom of the Perl Monks concerning the following question:
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"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ClearCase and Perl
by moritz (Cardinal) on Mar 06, 2014 at 20:13 UTC | |
by czach12345 (Initiate) on Mar 06, 2014 at 20:49 UTC | |
Re: ClearCase and Perl
by GotToBTru (Prior) on Mar 06, 2014 at 19:35 UTC | |
by czach12345 (Initiate) on Mar 07, 2014 at 15:00 UTC | |
by czach12345 (Initiate) on Mar 07, 2014 at 19:47 UTC | |
Re: ClearCase and Perl
by Laurent_R (Canon) on Mar 06, 2014 at 23:15 UTC | |
by czach12345 (Initiate) on Mar 07, 2014 at 01:22 UTC | |
by adefaria (Beadle) on Mar 07, 2014 at 15:44 UTC |
Back to
Seekers of Perl Wisdom