Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.lang.perl Subject: Re: While learning PERL... a suggestion Message-ID: <1991Jan22.012359.24492@NCoast.ORG> Date: 22 Jan 91 01:23:59 GMT References: <1991Jan21.092204.11944@ux1.cso.uiuc.edu> <1991Jan21.174520.12207@iwarp.intel.com> <1991Jan21.201845.28080@ux1.cso.uiuc.edu> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.lang.perl Organization: North Coast Computer Resources (ncoast) Lines: 44 As quoted from <1991Jan21.201845.28080@ux1.cso.uiuc.edu> by phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN): +--------------- | My only comment is that this must be a very complex syntax to parse. | The mere existance of space between the handle and the string above | would separate things. I wonder if there are any cases where the | data to be printed could be an expression with a unary prefix operator | that could cause an apparent ambiguity as to look like a binary infix | operator between the filehandle and the data, thus appearing to be an | expression to be printed on STDOUT. +--------------- I don't know what Perl does in that case (Perl isn't installed on ncoast), but there is a disambiguator: the full syntax of "print" is: print FILEHANDLE [(] arguments [)]; Just enclose the arguments to be printed in parentheses. The ambiguity is no different from the usual Perl irregularity, where operators like "print", "chmod", and just about everything else take a following left parenthesis as an argument indicator a' la C functions. You just have to be careful. +--------------- | In what way does it affect them? I was getting the impression from the | man pages that these name spaces were separate. This was discussed in | the man pages with regard to passing by references, but I guess you are | now filling in the ambiguities of its affect elswhere. I'm not up on | subroutines yet (probably mostly due to not understand how the name | space works). +--------------- The problem is that the * syntax doesn't support specifying *which* namespace to alter: does "*x" refer to a filehandle, a scalar, an array, or an associative array? And you can't say "*$a" to specify which (not that it would help anyway, since filehandles don't have indicators and you would need to retain the current behavior of "*x" for compatibility. This can be viewed as a drawback of Perl, or of * indirection. ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY