in reply to Re: Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage
in thread Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage

Hey, super reply, jwkrahn. Thanks for the critique--seriously. I like having the opportunity to improve my style a bit, which is why I come here.

In answer to your questions:

1) I break out my code with subroutines simply for the sake of readability and organization. When I sit down to code, I write a simple block of steps in plain English as to what i'd like to do. From there, I build out the steps in code. If it turns out that over the course of hashing the code out, one of those routines needs to be called repeatedly, then i'm already there. :)

2) My understanding is that if I were to supply a single whitespace in the split call WITHOUT first boiling out the instances of >1 consecutive whitespaces, I may end up with an array filled with things like " foo" and "bar ", not "foo" and "bar". My goal there was to have an array filled with nothing but values of importance, not interspersed with values of no importance (whitespaces).

3) You are correct, I am doing a numerical compare on a string, and an exists call would suffice. This is just shorthand on my part. This way, I don't need to distinguish between numerical and non-numerical comparrisons in my code. Helps third-party readability too, I suppose.

4) I had derived "$lastValidBackupTime" using a different method earlier. The regex to deflate the string is a holdover from that method, and superfluous.

5) My goal there (if I remember correctly) was to break out a string containing a timestamp to something I could format neatly at will. See #3 above.

Thanks again for the writeup!
  • Comment on Re^2: Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage

Replies are listed 'Best First'.
Re^3: Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage
by jwkrahn (Abbot) on Mar 19, 2010 at 18:48 UTC
    I break out my code with subroutines simply for the sake of readability and organization.

    That is great for Perl4 code but you should really start using the warnings and strict pragmas in your code.

    2) My understanding is

    split has an exeption to the rule that the first argument is always interpreted as a regular expression and that exeption is a string with a single space character.    It is almost like split( /\s+/ ) except that any leading whitespace is ignored.    The exception is there so that Perl can imitate AWK with the -a switch.