Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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. 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 line 92, at e +nd of line syntax error at C:\Perl\programs\format line 92, at EOF Execution of C:\Perl\programs\format aborted due to compilatio +n errors.
What is causing the problem? Thanks in advance


In reply to Question on format statement by perl_seeker

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-05-26 12:43 GMT
Find Nodes?
    Voting Booth?

    No recent polls found