On Wed, Jun 18, 2008 at 12:27 PM, Graeme McLaren < [EMAIL PROTECTED]> wrote:
> > Hi all, I'm in need of a loop, can't seem to find what I'm looking for > online. I want to loop over this array ref inserting each hash value into > the DB at each iteration.I've got the following data structure which is > assigned to $aref: > > $VAR1 = [ { 'rate' => '1.98', 'name' => > 'Dollars -> Sterling' }, { 'rate' => '1.5', > 'name' => 'Sterling -> Euros' }, { > 'rate' => '0.75', 'name' => 'Dollars -> Euros' }, > { 'rate' => '2.05', 'name' => 'Sterling -> Dollars' > }, { 'rate' => '0.72', 'name' => > 'Euro -> Sterling' }, { 'rate' => '1.52', > 'name' => 'Euro -> Dollars' }, { 'rate' => > '1.98', 'name' => 'Amex Exchange Rate' } ]; > > > Can anyone help out with this? > > Much appreciated. > > G :) > Untested foreach(@{$h}) { while ( my ($k,$v) = each(%$_)) { print "$k $v\n"; } } -- [ Rodrick R. Brown ] http://www.rodrickbrown.com http://www.linkedin.com/in/rodrickbrown