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

In reply to Question on format statement by perl_seeker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.