Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2023-12-02 05:52 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?