Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Comparing checksums of local/remote files.

by gnat (Beadle)
on Aug 31, 2000 at 00:48 UTC ( #30400=note: print w/replies, xml ) Need Help??


in reply to Comparing checksums of local/remote files.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://30400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2023-12-02 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?