Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Hrmmm (Score:2, Insightful)

    This isn't too bad - All you need to do is call defined on the return value and you have a clean test for whether a module call has succeeded. It could be much worse ... They might not have documented this behaviour or indeed any module return values at all.

    All of this is moot if the module doesn't work though


    • by drhyde (1683) on 2003.11.03 8:34 (#25409) Homepage Journal
      Right, if it's documented, and is consistent across the module, what's the problem? If you prefer true/false, write a wrapper.

      And consider what happens if your function can legitimately return values from 0 upwards, or can fail. For instance "I updated 0 files in the specified directory" vs "I couldn't open the specified directory". In that case, I like to return undef for failure.