Many thanks to everyone who replied to my RE scoping problem. I have been able to simplify my code considerably. Much appreciated.
I have a data structure like this (this is simplified - each image has many fields): $database = { imagedata => { 'image1' => { 'filename' => [ 'foo.gif' ], }, 'image2' => { 'filename' => [ 'bar.gif' ], }, 'image3' => { 'filename' => [ 'foobar.jpg' ]. } } }; I am extracting the filename for each image using: foreach $id ( keys %{ $database->{ 'image' } } ) { push @filenames, $database->{ 'image'}->{ $id }->{ 'filename' }[ 0 ]; } Is there any way I can generate a list of filenames without using a foreach loop? I feel I should be able to access it by referring the the keys of the imageX hash as a list, but I can't get my head around the syntax. TIA, Richard ===== I'm not tense. I'm just terribly, terribly alert. ----------------------------------------------------- Team Artonomy - Drawing Business Cartoons and illustration for web sites and business. http://www.team-artonomy.com/ ----------------------------------------------------- __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com