Hi Monks,

Looking on comments to improve my Perl skills. I am revising a script that we use to validate Autosys JIL (Job Insertion Language) files before they are promoted to production. One of the rules is that if insert_job is in the record set then owner must be in the same record. insert_job and owner are on separate lines of the record.

What I have done in the past was if I found insert_job set a flag varable to 1 and if the owner value was found in the record, set the varable to 0. Then if flag eq 1 at the end of the record, raise a error.

Thinking now to put the record into a hash and if $hash{insert_job} exists, then $hash{owner} exists or raise error.

Any other sugesstions? Not looking for full blown solutions, just ideas. We keep adding tests to this script, so I want to make sure I do something that allows for flexability


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.