Re: splt and hash problem

[email protected] (Rob Dixon)
Newsgroups perl.beginners
Message-ID <[email protected]>
Johnson, Reginald (GTS) wrote:
>
> Thanks for assistance Rob. By adding the parentheses in the split I get
> the expected results. Yes I do need to cleanup the code. The lines that
> are indented are only for debugging, so I am going to delete them
> anyways. I will keep your suggestions in mind for my next post.

I think you mean the lines that /aren't/ indented, but it's hard to tell. If
you're using a mail client that lets you change the line wrap then I suggest
that you disable it for this group. Wrapped code can be very confusing. It's
common practice to 'outdent' a temporary line of code so that it stands out for
removal later, which I think is what you've done, for instance, with the line

  print "$sumdate,$sumactivity,$sumnode,$sumbytes\n";

I think you're using the tab character for indenting, giving you eight-column
indentation which is too much to show the structure of the blocks properly.
Four-column indenting is recommended.

> Is commenting the closing brackets really a bad thing? I think it makes it 
> easier for debugging.

Not in itself no, but if you find that it helps then probably either your layout
needs improving or your blocks are too long. Pairing of braces should be very
obvious without needing comments.

> I don't have real comfort level yet with using hashes so I am sure I
> will have further questions.

You are welcome to ask as much as you want. Bear in mind that your questions
will also help other people throughout the world.

Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.