Hello,
this is the code i've been trying to execute. A lot of it conributed by roboticus in a previous post.
$mr_date = localtime();
open FS, ">mmonthlyfancy.doc" or die "Can't open file";
format FS =
@<<<<<<<<<<<<<<<<<<<<<<<< @#### @<< @<< @# @###### @##### @<<<<
+<<<<<< Rs.@####.## ~
$consname, $consno, $subdvn, $tow, $phase, $chequeno, $receiptno, $dat
+e, $amount
.
format FS_TOP =
@|||||||||||||||||||||||||||||||||||| Pg @<
"MONTHLY METER WORKS REPORT", $%
Date @<<<<<<<<<<<<<<<<<<<<<<<
$mr_date
Consumer name CN. Sub. TOW Ph. Chq.no. RN Date Amt.
------------- ---- ---- --- --- ------- ---- ---- ----
.
format TOTAL=
------------------------------------------------------------
+
Rs.@########.##
$fb_rp_1_tot
+
Signature
.
open(MI,"<mmonthlyinputt.txt");
@mr_rows = <MI>;
close(MI);
$fb_rp_1_tot = 0;
$fbqty1= 0;
foreach (@mr_rows) {
chop();
($consname, $consno, $subdvn, $tow, $phase, $chequeno,
$receiptno, $date, $amount) = (split(/!/));
$consname = "" if !defined($consname);
$consno = 0 if !defined($consno);
$subdvn = "" if !defined($subdvn);
$tow = "" if !defined($tow);
$phase = "" if !defined($phase);
$chequeno = 0 if !defined($chequeno);
$receiptno = 0 if !defined($receiptno);
$date = "" if !defined($date);
$amount= 0 if !defined($amount);
$sub1='FB';
$tow1='RP';
$ph1='1';
if (($subdvn eq $sub1) && ($tow eq $tow1) &&
($phase eq $ph1))
{
write(FS);
$fb_rp_1_tot += $amount;
$fbqty1 = $fbqty1 + 1;
}
}
my $dofh = select(FS);
$~ = "TOTAL";
select($dofh);
write(FS);
close(FS);
I keep getting this error (ugh)
Format not terminated at C:\Perl\programs\format test.pl line 92, at e
+nd of line
syntax error at C:\Perl\programs\format test.pl line 92, at EOF
Execution of C:\Perl\programs\format test.pl aborted due to compilatio
+n errors.
What is causing the problem? Thanks in advance
perl_seeker