Marija Silajev wrote:

> Hi,
> 
> I create a hash like following:
> 
> 
>  $Data{$KEYS} = { key1 => [@array1],
>                  key2 => [@array2],
>                     };
> 
> 
> with:
> foreach $KEYS ( keys %Data){
> print "Key1 data : @{$Data{$KEYS}{key1}}\n";
> }
> 
> I manage to print the whole @array1 in one line like:
> 
> Key1 data : 4321 432 765 341
> 
> and i would like it to look like
> Key1 data :
> 
> 4321
> 432
> 765
> 341
> 
> I still didn'n manage to get it like this.
> Thanks in advance for help.
> 
> 
> Marija

try:

my %hash;
my @i = (1..5);
my @j = (6..9);

$hash{'key'} = { key1 => [@i], key2 => [@j] };

while(my($key,$value) = each %hash){
        while(my($k,$v) = each %{$value}){
                print "$k data:\n";
                foreach my $ar (@{$v}){
                        print "$ar\n";
                }
        }
}

__END__

prints:

key1 data:
1
2
3
4
5
key2 data:
6
7
8
9

david

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

Reply via email to