On 29Jan2016 18:12, Steven D'Aprano <st...@pearwood.info> wrote:
On Fri, 29 Jan 2016 11:25 am, Chris Angelico wrote:
Probably the biggest thing to take note of is the Python object model
- how names and objects and assignment work. It's pretty
straight-forward, but if it's not what you're used to, you'll need to
get your head around it. Here's a good talk on the subject:
http://nedbatchelder.com/text/names1.html
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, and then I
get confused. Is there a good discussion of how names and references work
in Perl, equivalent to Ned's discussion?
The prefices:
$ = scalar (numbers and strings)
@ = array (lists)
% = hashes (dicts/mappings)
They are distinct namespaces, so you can use $foo and %foo in the same code for
different variables. No, I don't think that is a good idea.
Cheers,
Cameron Simpson <c...@zip.com.au>
--
https://mail.python.org/mailman/listinfo/python-list