Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Bad Module Code

by tilly (Archbishop)
on Jul 11, 2003 at 16:06 UTC ( [id://273445]=note: print w/replies, xml ) Need Help??


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().

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://273445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-18 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found