This problem would be straightforward in Perl. Whether it meets your requirements for efficiency depends on the criteria.

If the code just needs to be efficient (as in not wasteful), then Perl is probably better than C, etc. If it needs to run as fast as possible, then C might be your best bet. Considering that most of the time is spent executing other programs, I think it would be hard to tell the difference between comparable C and Perl implementations.

I would suggest looking at Time::HiRes (or Time::AutoRes); system or `` (backquotes) or qx//; reading and writing files (the <> operator, and print/printf); split and/or regular expressions (match operator m// or just //).

But if you're more comfortable in C than in Perl, C will be less hassle for you in the short term. If you have some time to learn, Use Perl!.

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re: Preferred language for scheduler assignment? by QM
in thread Preferred language for scheduler assignment? by kozter

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.