MESSAGE
| DATE | 2002-06-21 |
| FROM | Ruben Safir
|
| SUBJECT | Subject: [hangout] perl hash value
|
From owner-hangout-desteny-at-mrbrklyn.com Fri Jun 21 10:24:41 2002 Received: from www2.mrbrklyn.com (localhost [127.0.0.1]) by www2.mrbrklyn.com (8.12.3/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id g5LEOftN026281 for ; Fri, 21 Jun 2002 10:24:41 -0400 Received: (from mdom-at-localhost) by www2.mrbrklyn.com (8.12.3/8.12.3/Submit) id g5LEOfup026280 for hangout-desteny; Fri, 21 Jun 2002 10:24:41 -0400 X-Authentication-Warning: www2.mrbrklyn.com: mdom set sender to owner-hangout-at-www2.mrbrklyn.com using -f Received: from www2.mrbrklyn.com (localhost [127.0.0.1]) by www2.mrbrklyn.com (8.12.3/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id g5LEOVtN026269; Fri, 21 Jun 2002 10:24:31 -0400 Received: (from ruben-at-localhost) by www2.mrbrklyn.com (8.12.3/8.12.3/Submit) id g5LEOVL7026268; Fri, 21 Jun 2002 10:24:31 -0400 Date: Fri, 21 Jun 2002 10:24:31 -0400 From: Ruben Safir To: steven melendez Cc: hangout-at-www2.mrbrklyn.com, learn-at-www2.mrbrklyn.com Subject: [hangout] perl hash value Message-ID: <20020621142431.GA26160-at-www2.mrbrklyn.com> References: <20020621141036.5940.qmail-at-web14003.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020621141036.5940.qmail-at-web14003.mail.yahoo.com> User-Agent: Mutt/1.3.27i Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: Ruben Safir List: New Yorkers Linux Scene Admin: To unsubscribe send unsubscribename-at-domian.com to hangout-request-at-www2.mrbrklyn.com Content-Length: 2142 Lines: 90 Status: RO X-Status: X-Keywords: X-UID: 1319
This is covered int he Perl Classes given by NYLXS which are inexpenssive.
There is no such thing as an array of arrays. There is only an array of array references
Something like this would work
$myhash{ $reararyref1 => [$arrayref2 ,$arrayref3...] $reararyref2 => [$arrref4, arrayref5 ], $reararyref3 => [$arrref4, arrayref5 ], $reararyref4 => [$arrref4, arrayref5 ], $reararyref5 => [$arrref4, arrayref5 ], $reararyref6 => [$arrref4, arrayref5 ], $reararyref7 => [$arrref4, arrayref5 ], $reararyref8 => [$arrref4, arrayref5 ], }
Or just assign them like this
$arrayref = \-at-myarray; $arrayref2 = \-at-myarray;
%hash = ($arrayref = > $arrayref2);
or
$hash[1][2] = value;
Ruben
On Fri, Jun 21, 2002 at 07:10:36AM -0700, steven melendez wrote: > Hi, > > Does anyone know how what the syntax is for defining a > hash whose values consist of an array of arrays. > > ie. something like > %hash = ( > "1" => ((array),(array),(array)) > ); > > but I don't think the value syntax is correct > > Thanks for any help, > > -steven > > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > > ## WWWAC VWW Nite: 21 DOG YEARS, 6/21 ** WWWACnic in Central Park, 6/23 ## > ## The World Wide Web Artists' Consortium --- http://www.wwwac.org/ ## > ## To Unsubscribe, send an e-mail to: wwwac-unsubscribe-at-lists.wwwac.org ##
-- __________________________
Brooklyn Linux Solutions __________________________ http://www.mrbrklyn.com - Consulting http://www.brooklynonline.com - For the love of Brooklyn http://www.nylxs.com - Leadership Development in Free Software http://www.nyfairuse.org - The foundation of Democracy http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net http://www2.mrbrklyn.com/mp3/dr.mp3 - Imagine my surprise when I saw you... http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....
1-718-382-5752
____________________________ New Yorker Linux Users Scene Fair Use - because it's either fair use or useless....
|
|