question that occurs is - line 34 is setting an execute flag against each value held on the hash table?
Well, sortof...
The "execute" is just really a label. The line that you refer to...
# Set everything to initially be executed for (keys %scripts) { $scripts{$_}{execute}++; }
..just iterates through the hash, incrementing the value of $scripts{$key}{execute} for each $key. As none of these keys exist at this point, they are created (autovivication) and their respective values are set to 1.

So what we end up with is..

$scripts{1}{execute} = 1 $scripts{2}{execute} = 1 etc...
The same thing happens a little later on (on line 45)...
for (keys %scripts) { $scripts{$_}{execute}=undef; }
...but here we're setting them all to undef.

Then when we get into the main loop, the first thing we do is to test whether that key exists, and if it doesn't we skip it and move on to the next one...

# Skip this one if we need to next SCRIPT if !defined $scripts{$script}{execute};
Incidentally, those for loops above could be done a little more elegently (and more efficiently) with a map...
map { $scripts{$_}{execute}++; } keys %scripts;

Which book covers this - I've bought most of the O'Reilly books
Perl books that I have and would recommend are: I have several others, but they are the three that I personally refer to most often.
in the sense of different employers and the constraints that might apply depending on employer!
Actually, I can empathise with this. I have recently changed employer and moved from an environment that was primarily *nix to one that is primarly *shudder* 'doze. And it hurts, believe me. But fortunately, I am in a position where I do have some level of control - so I'm busily replacing windows boxes with Linux ones whenever and where-ever I can ;)

Finally...

Sorry if the experience comment offended
None taken. And I _was_ going to let it (and the other comments) go. But after I thought about it a bit I decided that I needed to clarify my position as I felt that I'd been misunderstood (and mis-represented).

Cheers, and good luck with your task at hand!
Darren :)


In reply to Re^5: Go to? by McDarren
in thread Go to? by Ronnie

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.