patmcl has asked for the wisdom of the Perl Monks concerning the following question:
open (BZF, "< $bzWdF") or die "$!\n"; binmode(BZF); # Read file in binary mode read(BZF, $rcrd1, $BytPrRcrdBZF) == $BytPrRcrdBZF; @tstsLocat = unpack(" n32 ", $rcrd1); for (my $tstcnt=1;$tstcnt<=$tstsLocat[0];$tstcnt++){ seek(BZF, $tstS, 0) or die "seek:$!"; ## Build Performance Data HOH. $validTst= buildTblEntry($tblEnt,$tstcnt); if ( $validTst ==1){ my $outF= $tblEnt.".txt"; open (OUTF, "> $outF") or die "$outF $!\n"; my $ofh = select(OUTF); $% = 0; $= = 59; ## Print report Performance Data Sheet &prntRptPerfmanceSheet($tblEnt); ## Loop thru Equipment List entries for(my $eq1b_a="",my $eq1b_n=0; $doneEq!=1;){ read(BZF, $rcrd1, $BytPrRcrdBZF) == $BytPrRcrdBZF or die "shor +t read EQ\n"; $eq1b_a= unpack(" A2 ", $rcrd1); $eq1b_n= unpack(" n ", $rcrd1); last if(($eq1b_a eq 'XX') || ( $eq1b_n == 0xFFFF)); #XX indica +tes end of entries ## Print report Equipment List $doneEq = prntHdEQ($tblEnt); $~ = "BLANK_LINE";write; } ##Setting up Line Item Table & Message Table files and Info open (LIT, "< $tPI{$tblEnt}{litbl}") or die "Error opening Line Item Table: $!\n"; open (MST, "< $tPI{$tblEnt}{mstbl}") or die "Error opening Message Table: $!\n"; binmode(LIT); # Read Line Item table in binary mode binmode(MST); # Read Message Table in binary mode getLItTblInfo($tblEnt); getMsgTblInfo($tblEnt); ## Loop thru Data entries in BZ file for current test run for(my $doneData=0; (tell BZF)<$tstE; ){ read(BZF, $rcrd1, $BytPrRcrdBZF) == $BytPrRcrdBZF or die "shor +t read Data\n"; last if (unpack(" n ", $rcrd1) == 0xFFFF); #FF indicates end o +f data segment ## Print report Data $doneData= bZData($tblEnt); last if $doneData; } &page; #print blank lines till $- =0; $%=0; #TRying to clean up for next test $-=0; #TRying to clean up for next test select($ofh); close OUTF; } } close BZF or die "Could close file $!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Format _top
by apl (Monsignor) on Apr 30, 2008 at 14:43 UTC | |
by patmcl (Novice) on Apr 30, 2008 at 14:54 UTC | |
by apl (Monsignor) on Apr 30, 2008 at 15:01 UTC | |
|
Re: Format _top
by Narveson (Chaplain) on Apr 30, 2008 at 18:47 UTC |