Fresh eyes didn't help much lol, I think perhaps I didn't explain the point of merging the scripts adequately.
The value that's printed in $defLine is the full line found in $defData after finding matching line in $AgentData, that seems ok. The $flag (yes/no) is telling me if that $defLine is also found in $scheduleData and if it is, then also scroll up and tell me the last matched regex capture for schedule name. We can't really scroll up, that's why I was using the look behind, It looks like you're putting that in $scheduleName but since it's being iterated before you go through $defData I don't understand the code suggestion as we don't know what we're looking for at that step.
The result looks ok in your example but it wouldn't actually work without setting the static variable in $wantedSchedule which I can't do because that needs to be dynamic data from the above, my example was static in the second script because I didn't know how to get the data out of the first one, but that's what I was asking for additional assistance with, I'm not sure I was clear or maybe I don't understand your proposal.
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.