in reply to Determine files added/removed (code for magazine article)

You added error checks, good. You didn't do it as suggested in perlstyle, your error checks don't include the information in $!.

My advice about unless got ignored. Its value isn't obvious until you've personally been through a couple of debugging sessions. But I highly recommend taking it.

Update: After reading the response, I understand the reasons for omitting $!. The unless issue, I once had the same opinion. People in your audience might well like it. It certainly can make the code scan well, but debugging is a different story.

  • Comment on Re: Determine files added/removed (code for magazine article)

Replies are listed 'Best First'.
Re: Re: Determine files added/removed (code for magazine article)
by McMahon (Chaplain) on Apr 16, 2004 at 22:11 UTC
    tilly, I believe my audience for this article will be both easily frightened by Script Magic and also impressed by little tricks. The more the code looks like English, the happier my editor will be.

    I didn't use $! because I didn't want to have to explain that particular piece of magic.

    I kept "unless" because it really is a neat feature of Perl, and it made the code more readable. (Or at least I think so.) Note that I translate the "unless" statement in the comments at the bottom.

    And again, thank you *very* much for your help.