On Fri, Jan 29, 2016, at 04:12, Ulli Horlacher wrote: > Steven D'Aprano <st...@pearwood.info> wrote: > > > Every time I make a half-hearted attempt to learn enough Perl syntax to get > > started, I keep running into the differences between $foo, %foo and @foo > > and dire warnings about what happens if you use the wrong sigil ... > $foo is a scalar (number, string, reference, file handle) > @foo is an array > %foo is a hash (dictionary in Python slang) > > and yes, you can use them all together in same code, they are different.
The main source of confusion is that $foo[5] is an element of @foo. $foo{'x'} is an element of %foo. Both of these have absolutely nothing to do with $foo. -- https://mail.python.org/mailman/listinfo/python-list