#!/usr/bin/perl use strict; use warnings; use Cwd; use Tie::File; use Fcntl; #Variable Declaration my $request="no"; my $dir=getcwd; my $md_dir=''; my @files=""; my $vp_file="vp_file"; my $view_tag = $ENV{'VIEW_TAG'}; my @data; print "\n\n Checking to see if you have any checkout files...\n "; if ( -z "/$view_tag/app_hwt/3126" || ! -e "/$view_tag/app_hwt/3126" ) { $md_dir='medium_duty'; } else { $md_dir='3126'; } ##################################### #HERE IS WHERE ITS GIVING ME THE ERROR ##################################### system ("cd /$view_tag/lib_engine/hwt"); system("cleartool lsco -cview -r -s > /$view_tag/lib_engine/hwt/co_file"); system ("cd /$view_tag/app_hwt/$md_dir"); system("cleartool lsco -cview -r -s >> /$view_tag/lib_engine/hwt/co_file"); if ( ! -z "/$view_tag/lib_engine/hwt/co_file" ) { print "\n ***You have check out files.*** "; print " Please either check them in or out before running this program again. \n"; print " Do you want to list chkout files y/n? [deflt no]: "; chomp($request = <>); if ( $request =~ /[Yy]/ ) { print "\n"; open(FILE, "/$view_tag/lib_engine/hwt/$co_file") || die "Cannot open co_file: $!\n"; print "\n"; } unlink "/$view_tag/lib_engine/hwt/co_file"; die("$!"); } else { print "\n\n Now Checking to see if you have any view private files...\n "; if ( ! -e "/$view_tag/lib_engine/hwt/co_file" ) { unlink "/$view_tag/lib_engine/hwt/co_file"; } `cleartool lsprivate -other -s > vp_temp`; my $temp_file="vp_temp"; open(FILE,"vp_temp") || die "Cannot open vp_temp:$!\n"; close(FILE); open(OUTPUT,">>vp_file"); tie (@data,'Tie::File',$temp_file, mode=>O_RDWR) or die "Can't tie to $temp_file:$^E\n"; (tied @data)->defer; foreach(@data) { # see ex.pl @files=grep(/\.c$/ || /\.h$/ || /\.a32$/ || /\.cfg$/ || /^Makefile_\..*$/ ,@data); } print OUTPUT @files; unlink "vp_temp"; if ( ! -z "vp_file" ) { print "\n You have view private files: \n "; open(FILE, "vp_file") || die "Cannot open vp_file: $!\n"; print " \n\n "; unlink "vp_file"; } else { print "\n Good Job! You have no view private files... \n\n "; if ( ! -e "vp_file" ) { unlink "vp_file"; } } }