in reply to Re: Reading from databse and writing to file.
in thread Reading from databse and writing to file.

Can somebody tell me if my code is correct.

Well, can you tell whether it's correct? If you do "perl -cw this_script.pl", does it report errors or warnings? If so, what are they? If not, it should run, so when you run it, does it do what you expect, or something else instead? (If there are run-time errors, what are they? etc)

  • Comment on Re: Re: Reading from databse and writing to file.

Replies are listed 'Best First'.
Re: Re: Re: Reading from databse and writing to file.
by SQLMan (Novice) on May 15, 2003 at 11:56 UTC
    This is the message that it is giving me. Useless use of string gt in void context at bookkeeping.pl line 51.
      I'm guessing that line 51 is this one:
      If $ncount gt 0;
      First, "if" should not be capitalized. Next, parens will help. Thirdly, use "==" ">" rather than "gt" for numeric comparison. (I think only the first point is mandatory; Perl is probably trying to interpret "If" as some sort of function call.)

      Apart from that, try formatting for legibility -- sensible and regular indents, breaking up long lines, and so on. It really cut down on the amount of time spent fixing things.