use strict; use warnings; my $usage = "usage: get_cqa_status.pl "; my $cqapath = ""; my $status_line = ""; ############################################ if ($#ARGV <0) { die "$usage"; } $cqapath = $ARGV[0]; open (FILE, "> $cqapath/CQA_STATUS")||die "can't open file $cqapath/CQA_STATUS for writing.\n"; while (<>) { next if ! /^CQA_STATUS/; print FILE; } close(FILE) || die "can't close$cqapath/CQA_STATUS after writing\n";