in reply to Bad Module Code

And what do you do when some stupid reason (eg a missing directory, write permissions) causes the files to not open and therefore for nothing to get written?

Not returning anything is reasonable. No error checking either is bad practice.

Replies are listed 'Best First'.
Re: Re: Bad Module Code
by CodeJunkie (Monk) on Jul 11, 2003 at 16:16 UTC

    Yes I totally agree with the principle of error checking obviously, but in this case I don't want it to die if the file is missing or it can't be printed. It is just printing HTML markup out to the browser so if it fails it should be reasonably obvious.

    Although having said that, it would be quite nice to print out a message explaining why it didn't work. So I will fix that.

    Cheers,
    Tom

      No, printing would be the wrong thing. Setting $@, using warn() (or something from Carp, throwing an exception would be better. But certainly don't print().