Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Cameron Simpson Newsgroups: comp.lang.python Subject: Re: psss...I want to move from Perl to Python Date: Sat, 30 Jan 2016 10:48:47 +1100 Lines: 27 Message-ID: References: <56ab10f4$0$1606$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Trace: news.uni-berlin.de N+j1w0HXaZO5Y4qoPMrSMgY0MBuIe/Iorwio/pk0alyA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'warnings': 0.03; 'subject:Python': 0.05; 'assignment': 0.07; 'perl,': 0.07; 'cc:addr:python-list': 0.09; 'python': 0.10; 'jan': 0.11; 'syntax': 0.13; '2016': 0.16; '>in': 0.16; '>on': 0.16; 'dire': 0.16; 'discussion?': 0.16; 'distinct': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'hashes': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simpson': 0.16; 'to:addr:pearwood.info': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'variables.': 0.22; 'cheers,': 0.22; 'cc:no real name:2**0': 0.22; 'am,': 0.23; 'references': 0.23; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'equivalent': 0.27; 'fri,': 0.27; 'perl': 0.29; 'array': 0.29; 'objects': 0.29; 'work.': 0.30; 'code': 0.30; 'probably': 0.31; "d'aprano": 0.33; 'steven': 0.33; 'running': 0.34; 'attempt': 0.35; 'subject:': 0.35; 'but': 0.36; 'there': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'no,': 0.38; 'received:localdomain': 0.38; 'names': 0.38; 'wrong': 0.38; 'subject:from': 0.39; 'enough': 0.39; 'your': 0.60; "you'll": 0.61; 'different': 0.63; 'to,': 0.63; 'between': 0.65; 'cameron': 0.66; 'differences': 0.66; 'biggest': 0.67; 'strings)': 0.84; 'subject:want': 0.93 Content-Disposition: inline In-Reply-To: <56ab10f4$0$1606$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102263 On 29Jan2016 18:12, Steven D'Aprano 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