Perhaps this is a dumb idea, but after reading the entire thread, there are several good points. Difficulty of parsing, tying the parser too close to the format, what are you going to do with the output... Basically, I suggest that you have an option to dump the data in a hash in Data::Dumper (or similar) format, so that other programs can just *load* the data. Then you could provide a subroutine that dumps it in the aforementioned format for compatibility sake. If people want other odd formats, they could easily load the data structure and generate what they want. You might structure it something like this: (Note: I've never used Data::Dumper and am unfamiliar with its output)
$results = {
'scripts' => {
't/qrt.t' => {
'Status' => 'OK', 'Stat' => '9', 'Wstat' => '2048',
'Total' => '12', 'Fail => '0', 'FailList' => { }
},
't/bar.t' => {
'Status' => 'Failed', 'Stat' => '4', 'Wstat' => '1024',
'Total' => '13', 'Fail => '4', 'FailList' => {
'2' => 'Failed msg 2', '6' => 'Failed msg 6',
'7' => 'Failed msg 7', '8' => 'Failed msg 8'
}
},
't/foo.t' => {
'Status' => 'Failed', 'Stat' => '1', 'Wstat' => '256',
'Total' => '10', 'Fail => '1', 'FailList' => {
'5' => 'Unexpectedly Succeeded'
}
}
},
'time' => '0 wallclock secs ( 0.10 cusr + 0.01 csys = 0.11 CPU)'
};
Roboticus
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.