On Sat, Sep 10, 2016 at 03:34:02AM +0200, Sam Kington wrote:

> (A) To say, flexibly, ???I want a data structure that looks like this???, and 
> to be able to say (1) this field must look exactly like this, (2) this field 
> should look like this, and remember it, (3) this field should exist, but I 
> don???t care what its value is, and (4) there might be additional fields but 
> I don???t care about them for the purpose of this test.

Investigate Params::Validate (which you're already using elsewhere in
your code, although you're not using all of its functionality). It's pretty
powerful.

For checking deeply nested data structures in XML I like XPath.
Data::DPath appears to allow similar syntax for inspecting perl data
structures.

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

Just because it is possible to do this sort of thing
in the English language doesn't mean it should be done

Reply via email to