in reply to Need Help: PERL and Binary Data

How do I even begin?

  1. You search CPAN, the central repository for Perl code. This is always the first step, because you are likely not the first person to try your task. Unfortunately, no one has submitted any STDF modules to CPAN (yet).
  2. You search Google (classic) and Google Code. When I searched for combinations of Perl, STDF, and "Standard Test Data Format", I found (and ranked worst-to-best in my opinion):
    • FreeSTDF is an active project to manipulate STDF files.
      • It is written in C.
      • It is BSD-licensed.
    • PySTDF is a *very* active project to manipulate STDF files.
      • It is written in Python.
      • It is an event-based stream parser, and so may be too complex for your purposes.
      • It is GPL-licensed.
    • Michael Hackerott has a large ( >9000 lines) body of code to handle STDF files.
      • It is written in Perl.
      • It is dual-licensed like Perl: GPL and Artistic licenses.
      • There is one module, two programs that use the module, and two independent programs.
      • The code is, IMHO, of high quality.
      • It can output an XML-ized version of STDF, for use by other programs.
    • Datalog sells STDF4X, which bears a promising description:
      STDF Binary Datalog Reader - ... In addition to its powerful data locating and filtering features and easy to use GUI, the tool can be used with your favorite scripting language such as Perl or Python to automate the frequently performed tasks. ... Output is optimally formatted for further filtering with regular expressions.
      • It is a commercial product.
      • It has an option to recognize well-known STDF quirks from other vendors, and compensate for them.
      • I have no idea what it costs, but I would bet that, long-term, it is cheaper to buy it instead of writing or adapting equivalent code.
      • It is Windows-only, but you could use Samba or NFS to allow Windows and SunOS to both work on your files.

From looking at the STDF Specification and Michael Hackerott's code, I judge the format to be of difficulty 5 (out of 10, where 1 is tab separated values, and 10 is MPEG video {and SMB is 11}). The format is hairy enough that I would press Management to buy the STDF4X product, even if only to double-check that my Perl code was completely accurate.

Hope this helps, and good luck to you.