>>>>> "Graham" == Graham Barr <[EMAIL PROTECTED]> writes:

Graham> There is a difference

Graham> sub abc { return (7,8,9) }

That's returning either a list or a comma operator result, depending
on context.

Graham> sub def { my @a = (9,8,7); return @a; }

That's not returning the array.  That's returning a copy of the contents
of @a in a list context, and the number of elements of @a in a scalar
context, using the "@a" operator.  You still haven't "returned the array".

Graham> I am not refering to context, but what the user types. If an author
Graham> does not document the two subs above correctly as returning a list and an array
Graham> then a user may get surprised.

Yes, but the first part is getting the naming right.  You don't
"return an array". :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to