Perl : Assigning multile hash values to a single array

I know that

@food = %fruit;

Works. But how do I assign %fruit and %veggies to @food ?

Try:

@food = (%fruit, %veggies);
1 Like

Thanks you. .... yeah ... not sure why I sometime miss the obvious. Hit the drawing board again and came up with this.

my %fruit = (
fruit1 => 'apple',
fruit2 => 'pear',
);
my %veggie = (
veg1 => 'carrot',
veg2 => 'pea',
);
@a = (%fruit, %veggie);
print "@a\n";