[pm-h] Interesting Blog Posts on Context & Array vs List

Reini Urban rurban at x-ray.at
Wed Feb 19 13:10:19 PST 2014


On Wed, Feb 19, 2014 at 10:04 AM, Robert Stone <drzigman at drzigman.com> wrote:
> Greetings,
>
> I came across this posting that goes into a lot of detail regarding context:
> http://perlhacks.com/2013/12/misunderstanding-context/

But beware if you talk about "context" to a core developer he might
misunderstand you.
In core there's a special context datastructure, the cx, storing scope
information.
http://cpansearch.perl.org/src/RURBAN/illguts-0.47/index.html#context

This article is talking about "gimme", if scalar, list or void (return) context.

> Linked in that article is also another interesting posting on the
> differences between Arrays and Lists.
> http://friedo.com/blog/2013/07/arrays-vs-lists-in-perl

This is a very good one.
Note that p5p just discussed the addition of a count method for arrays
and lists,
to get rid of the misleading name scalar @array,
and to do the right thing for count(@a, @b);

> Personally I find context one of the most fascinating aspects of Perl (Maybe
> someone should do a presentation!) and I must admit I've been guilty of
> referring to things as being in "Array Context".  Does anyone disagree with
> these postings or have any additional knowledge to share?

-- 
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/


More information about the Houston mailing list