--- Richard Smith <[EMAIL PROTECTED]> wrote:

> 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.

I think I just answered my own question, using map{}:

@filenames = map{ $database->{ 'image'}->{ $_ }->{ 'filename' }[ 0 ] } keys
%{$database->{ 'image' } };

But if anyone has a faster way?

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

Reply via email to