in reply to Testing if A is in a record, The B must be in the Record

cutter,
You don't indicate if you are using Parse::RecDescent , Parse::Yapp, or similar to validate the JIL files but if so, you could make a constraint of the grammar be your insert_job/owner relationship.

Alternatively, there is nothing wrong with your flag approach. If there are a bunch of relationships that need to be met than the hash approach sounds like a good idea. You can let the key be the first condition and the value be the second condition. It would then just be a matter of iterating over the hash looking for keys without values.

Cheers - L~R

  • Comment on Re: Testing if A is in a record, The B must be in the Record

Replies are listed 'Best First'.
Re^2: Testing if A is in a record, The B must be in the Record
by cutter (Acolyte) on Aug 03, 2006 at 17:35 UTC

    I have been looking at re-writing this script to use Parse::RecDescent for over a year, but since the script is "good enough" how it is, other fires get put out first. You know how it is.

    Thanks for the comments

      Even with P::RD, you'd be better off doing the test at the end as you are doing now. It greatly simplifies the grammar. In technical terms, it's best to seperate syntax from semantics. It sounds like you have a good solution.