At one level, your question is basically "I want to do something that's best done by existing software, only I can't install it" and the obvious answer is "well, fix whatever management or admin problem is preventing you from installing it".

I have no comments about the way you're checksumming or rexecing. That looks reasonable to me (although you don't check for errors in $?).

However, I can help you with Perl ...

I hate those uses of the hook. That's something that should be an if() in my books, even though it's more typing for you. Not to mention that the precedence of ?: will bugger you up:

$a % 2 ? $a += 10 : $a *= 2 ($a % 2 ? $a += 10 : $a) *= 2 # what it really is
Surprise. However, in all honesty, for things where precedence isn't an issue, it's a personal preference style matter. My tastes are to use ?: for picking between values, and if() for picking between bits of code.

Try this to remove the arrays:

my ($gg) = split ' ', $g; my ($hh) = split ' ', $h;
This makes use of the list context caused by the parentheses around $gg and $hh (without the parentheses you'd end up storing the number of fields in $gg rather than the first field), as well as the fact that split does no more work than it has to. If you're assigning to one item, it'll only split up to the first item.

Hope this helps,

Nat


In reply to Re: Comparing checksums of local/remote files. by gnat
in thread Comparing checksums of local/remote files. by hydo

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.