I have a preference for a method along the lines of the first layout you have mentioned.
However, have you considered using a xml structure and a perl module to manipulate it.
I am very fond of XML::Twig (requires XML::Parser) it has provided a very simple and enjoyable means of organising data and allows for simplifying the way in which I organise and handle data structures. Its kind of interesting and I have found it useful for a wide variety of tasks (especially in terms of organising site content).

You could see a relationship between the first file structure above and a xml file structure, if you stretch your imagination a little.

The flat line file pattern already suggests that students are containers for exams (I don't know whether the students would like that idea) so either way xml allows you to use differing attributes to identify unique objects sharing the same element type, instead of incrementing an identifier such as
pupil1==
Its a bit like saying:

#pupil=A Student|&exam=Maths 1&result=21#pupil=Foo Student|&exam=Scien +ce&result=35|&exam=knitting&result=75#pupil=Joe Bloggs|&exam=Head Sta +nd&result=100

I hope that doesn't fall flat...:)


In reply to Re: Which is the better option? by ceedee
in thread Which is the better option? by kiat

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.