in reply to Pull an array from a hash... or somthing

In your third attempt you are assigning the reference of the device array and not the array itself. Try:

my @array=@{ $hash_ref->{devices}->{device} };

Replies are listed 'Best First'.
Re^2: Pull an array from a hash... or somthing
by pez252 (Novice) on Feb 22, 2008 at 19:29 UTC
    I thought it had something to do with references vs arrays them selves. I made the changes you suggested and it works great. It is now returning an array as I had hoped and I can do my foreach $device (@devices) to get the name and id of each.

    Thanks a lot.