From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25826 invoked from network); 27 Aug 2004 21:30:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Aug 2004 21:30:16 -0000 Received: (qmail 730 invoked from network); 27 Aug 2004 21:30:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Aug 2004 21:30:10 -0000 Received: (qmail 16529 invoked by alias); 27 Aug 2004 21:29:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7941 Received: (qmail 16519 invoked from network); 27 Aug 2004 21:29:27 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 27 Aug 2004 21:29:27 -0000 Received: (qmail 98744 invoked from network); 27 Aug 2004 21:27:40 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 27 Aug 2004 21:27:37 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i7RLRa9o003925 for ; Fri, 27 Aug 2004 14:27:36 -0700 Date: Fri, 27 Aug 2004 14:27:36 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: ZSH User List Subject: Re: how to force scalar to be an array? In-Reply-To: <20040827154905.GA26846@spiegl.de> Message-ID: References: <20040827154905.GA26846@spiegl.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 I'm sorry, I missed the second (result="foo") assignment when I was trying the examples, so I thought you always had a multi-word scalar to start with. Ignore my previous message. A scalar is a scalar, and the result of splitting a scalar is only an array if the split actually does something. Further, using $=array forces the array to be a scalar and then applies the preceding rule. So your only safe bet is to actually assign the scalar to an array, and then use subscripting on the array.