in reply to Using Parse::RecDescent to parse Perl-ish strings without resorting to string eval
Is it feasible to output the Excel data in a known structured format, such as XML? That would open up the world of XML::XPath where you could query the XML-formatted data ... in effect letting something else (namely, XPath) do the dirty-work of pulling out the data you need.
The “model file” would not need to be the same format. If it consists of a series of lines containing “cell-address, and what should be in it,”then your code could work by constructing an XPath-string, letting XPath dredge the file for that piece of data, compare it, and move on.
“The model file” is the part that you can easily control; the student's homework is the Great Unknown. But if the complexity were hidden from view (XPath is very good at what it does, and XPath expressions are very powerful), the complexity of your program would be reduced by at-least half. I'd call that “a win.”
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Parse::RecDescent to parse Perl-ish strings without resorting to string eval
by polypompholyx (Chaplain) on Feb 29, 2008 at 20:21 UTC |