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

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.
  • We recently hit against a bug with this the opposite way round. The JSON [cpan.org] module's objToJson function takes a Perl data structure and returns a Json string representation of it. But if the input is undef then it uses bare return.

    The bug was that this return value was being used in the parameter list of another function, and the bare return meant there was a argument missing.

    Once we'd spotted the bug it was simple to put scalar before the call to objToJson, but it was subtle. If a function is documented as always returning exactly one piece of data then it might be better if it always does that, even if that means returning undef in list context.