in reply to Re: Context aware functions - best practices?
in thread Context aware functions - best practices?
You are aware that
scalar (@x = foo(1,2,3,5));
will evaluate to the number of elements returned by foo rather than return the last one of them, right? :) And no, I even considered returning an array ref. (But not a concatenation, yuck - if the caller wants unstructured data he can flatten the array himself, but he can't well unflatten a string.) I'm not going to ask this particular function for two return values when I'm only interested in one of them though. I just don't want to have to remember and to type the parens in every instance I only ask for one return value, because that will be pretty a common case. CGI::param works the same way with good reason, f.ex.
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Context aware functions - best practices?
by LAI (Hermit) on Jan 14, 2003 at 21:50 UTC | |
by Aristotle (Chancellor) on Jan 14, 2003 at 23:32 UTC | |
by LAI (Hermit) on Jan 15, 2003 at 14:33 UTC |
In Section
Seekers of Perl Wisdom