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

use Perl Log In

Log In

[ Create a new account ]

merijnb (296)

merijnb
  (email not shown publicly)

I do Perl for $VBC

Journal of merijnb (296)

Thursday September 04, 2003
09:19 AM

Flabbergasted

[ #14487 ]

Sometimes I can still be amazed by the code I am presented with. Yesterday I was helping out somebody to debug his script. This used some helper application, also written in Perl. The helper app returned with an error. Which is fine.

The error message was "unknown error". Which could be fine, but definitely isn't helpful. Looking in the helper application at the actual code to see where it decides that it has an error that it doesn't know about, which is an odd concept if you think about it, I came across the following construction:

if ($errorstring =~ /something/) {
    return "Something error"
} elsif ... {
    ...
} else {
   return "unknown error"
}

WTF? So the programmer of this code had the $errorstring, but chooses not to pass it back. Furffu.

Glad it is Perl though, where I can copy the code, change it and find out what actually is the problem.

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.