I want the files counted as I think of it as the only way to get different $carboxyl entries. All I want is just a number, from 1 to whatever, next to my $carboxyl entry, so that I will be able to tell the files apart.

This number doesn't have to be associated with the files, it doesn't have to be a file counter, it just has to be consecutive and different every time, for each of the resulting pdb files.

It's just because I'm a newbie that I thought that associating my goal with a file counter would make more sense and would be easier to implement.

$atomcount and @atom aren't unaccounted for, they're just further up in my script (sorry about that, I didn't know how to include a concise part without copying the whole thing). Also, I'm opening the pdb files and printing coordinates (x,y,z) in them, from the files that are already open (again, opened further up in my script and these are the files of the foreach loop)

Thank you (all) for you help. I'll try your suggestions and update you, hopefully I'll get it right - at least in my mind or on paper.

Update: Yes, pdb is protein data bank files. Although I'm an idiot and instead of pdb it should read gro, as I changed to gro files (and thus the format is wrong for pdb files). I'm really sorry about that, thankfully it doesn't change my question though so not a disaster (I'm embarrassed)


In reply to Re^3: counter of files? something else? by fasoli
in thread counter of files? something else? by fasoli

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.