Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • So here's a thought: most uses of pack should be wrapped up in a small subroutine, shouldn't they? I mean, if you are unpacking a struct, make two routines (to convert either direction) that take binary data on one end and an array, hash, or object on the other.

    Whoa, boy. You've got a good idea, but you're starting to overgeneralize.

    What you're talking about is properly factoring your code. Your program is made up of a string of little operations performed in a meaningful order. One of those oper

    • The solution is to learn the language.

      That idea alone could save buckets of time writing workarounds and useless comments.

      ... otherwise, you're just writing tests to prove that 1+1 is still equal to 2.

      Hey, I know a couple of people who've written tests just like that. Aren't you glad we aren't breaking chomp anymore?

      • That idea alone could save buckets of time writing workarounds and useless comments.

        A tradition at my old workplace persisted for years and passed on to every intern and co-op that when you wrote:

        open(FILE, $filename) || die "Cant open file: $!";

        you should leave out the apostrophe in the word "Can't," because that once broke something. Obviously, what it broke was somebody who tried to use single quotes for the whole thing, but that part wasn't understood.

        --
        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • Hey, I know a couple of people who've written tests just like that. Aren't you glad we aren't breaking chomp anymore?

        Well, I added some tests to make sure that 1 + 1 == 2
        t/op/arith.t [activestate.com].

        Which reminds me - Schwern is not poorer yet :-( [mpe.mpg.de]