RE: array of hashes looping prob

2004-10-04 Thread Charles K. Clarkson
From: Graeme McLaren  wrote:

: Ok everyone I got it:
: 
: for my $a (@result){
: 
: for my $h (keys %$a){
: 
:   print   "$h = $a->{$h} ";
: }
: }

Avoid using $a and $b as variables. They are used
by 'sort' and treated special by perl. Use descriptive
variables instead. I used $key because I don't know
how result is organized. ($column, $section, $row, etc.
would be better.)

for my $result ( @result ) {
for my $key ( keys %$result ) {
print "$key = $result->{$key}";
}
}


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: array of hashes looping prob

2004-10-04 Thread Graeme McLaren
Ok everyone I got it:
for my $a (@result){
   for my $h (keys %$a){
 print  "$h = $a->{$h} ";
   }
}
Cheers,
G :)

From: "Graeme McLaren" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: array of hashes looping prob
Date: Mon, 04 Oct 2004 10:27:37 +0100
MIME-Version: 1.0
X-Originating-IP: [212.250.155.249]
X-Originating-Email: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
Received: from lists.develooper.com ([63.251.223.186]) by 
mc1-f5.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Mon, 4 Oct 2004 
02:28:11 -0700
Received: (qmail 17987 invoked by uid 514); 4 Oct 2004 09:28:09 -
Received: (qmail 17978 invoked from network); 4 Oct 2004 09:28:08 -
Received: from x1.develooper.com (63.251.223.170)  by lists.develooper.com 
with SMTP; 4 Oct 2004 09:28:08 -
Received: (qmail 7646 invoked by uid 225); 4 Oct 2004 09:28:08 -
Received: (qmail 7638 invoked by alias); 4 Oct 2004 09:28:08 -
Received: from bay16-f17.bay16.hotmail.com (HELO hotmail.com) 
(65.54.186.67)  by la.mx.develooper.com (qpsmtpd/0.27.1) with ESMTP; Mon, 
04 Oct 2004 02:28:06 -0700
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; 
Mon, 4 Oct 2004 02:28:02 -0700
Received: from 212.250.155.249 by by16fd.bay16.hotmail.msn.com with 
HTTP;Mon, 04 Oct 2004 09:27:37 GMT
X-Message-Info: JGTYoYF78jFv9gV82oMMe3ImNAX5LeNb
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Post: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
Delivered-To: mailing list [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=-0.0 required=8.0tests=BAYES_44
X-Spam-Check-By: la.mx.develooper.com
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 04 Oct 2004 09:28:02.0655 (UTC) 
FILETIME=[72372EF0:01C4A9F4]
Return-Path: [EMAIL PROTECTED]

Hey all I'm stuck looping through an array of hashes, here is what I have:
##
for my $a (@result){
   for my $h (keys %$a){
$tst = "$h->{$a}";
   }
}
##
@result contains a hashes, I can die it out ok... there is something 
wrong when I try looping and assigning it to $tst . any ideas?

Thanks in advance for any tips.
G :)
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

_
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



array of hashes looping prob

2004-10-04 Thread Graeme McLaren
Hey all I'm stuck looping through an array of hashes, here is what I have:
##
for my $a (@result){
   for my $h (keys %$a){
$tst = "$h->{$a}";
   }
}
##
@result contains a hashes, I can die it out ok... there is something 
wrong when I try looping and assigning it to $tst . any ideas?

Thanks in advance for any tips.
G :)
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]