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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Opposite Bug (Score:1)
We recently hit against a bug with this the opposite way round. The
JSON [cpan.org]module'sobjToJsonfunction takes a Perl data structure and returns a Json string representation of it. But if the input isundefthen it uses barereturn.The bug was that this return value was being used in the parameter list of another function, and the bare
returnmeant there was a argument missing.Once we'd spotted the bug it was simple to put
scalarbefore the call toobjToJson, 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 returningundefin list context.Reply to This
Re: (Score:2)
You know, I did cover that specific case in my post :)