The Artima Developer Community
Sponsored Link

Java Buzz Forum
Why you should check for errors :)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Why you should check for errors :) Posted: Feb 5, 2005 8:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Why you should check for errors :)
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
What's wrong with this picture: open(OUTFILE,">${tmpdir}${code}"); print OUTFILE $scode; close(OUTFILE); Well, it may not be my style. But, the biggest problem is What happens if the OUTFILE isn't created? I ran into this when my security codes weren't working. There was no bad output, other than a glimpsing error that I saw on a screen saying that there was something up with the print OUTFILE $scode line. The problem was that the $tmpdir had gotten bad permissions. It would be a lot nicer if we had: open OUTFILE, ">${tmpdir}${code}" or die "I guess I should tell someone that this didn't work. opening ${....}: $!"; I always like to run my scripts with -w, use strict; etc... like a good boy. This had me change mt-scode.cgi too: #my $cookie = $cgi->cookie(-name=>'code',-value=>$code); $cookie doesn't seem to be used anymore and -name=>code was bare instead of quoted anyway. Now everyone is happy, and the codes are back :)

Read: Why you should check for errors :)

Topic: Creative workouts for your brain Previous Topic   Next Topic Topic: another instance of crappy diagnostic messages

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use