in reply to Discussing a name space

You should provide a perl interface for the output as well (as a hash ref or something), not just a CSV output.

If you provide only CSV output and somebody wants to access the statistics from within perl, it has to parsed again - which is rather ugly.

Replies are listed 'Best First'.
Re^2: Discussing a name space
by fernandes (Monk) on Sep 11, 2007 at 15:25 UTC
    Someone has told me this before you... But, there are a lot of modules for CSV parsing and the output may be very large. From 300 texts, I've obtained 25 MB of statistical data (some cells are reduntant, and can be reindexed in an inverted fashion at second stage). By the way, I use SPSS for generating meta-data, like tf-idf scores, and a CSV file is perfect, because SPSS can easily parse it.
    But I'm really interested in improving the module API. So, if you have time, I would love to receive your code.
      A CSV is just a representation of a two dimensional array, so each time you write print OUTFILE join(',', @row); you can just push @rows, \@row.

      The best idea is probably to let the user decide what to do with the data.

      At some point in your module you certainly have the data in an internal format - adding that to an array or hash should be trivial, as well as making that accessible to the user.