in reply to 3d arrays

Thank you for your help so far. It is much appreciated. I have to admit to still feeling rather confused though. What I want to print out is the exact co-ordinates as well as how many beans, and some of these co-ordinates wont be whole numbers ... for example
101.67 80 5
312.0 67.8 7
and so on
Perhaps arrays arent the best way of doing this, I dont know.
Any thoughts much appreciated.

Replies are listed 'Best First'.
Re^2: 3d arrays
by deibyz (Hermit) on Apr 07, 2005 at 16:50 UTC
    If you need real coordinates, an Array wouldn't be enough. You can switch to a HoH (Hash of hashes), something in the lines of:

    my $HoH = { 101.67 => { 80 => 5 } , 312 => { 67.8 => 7 } };

    Then you can retrieve the values with $HoH->{312}{67.8}.

    Just be aware that hash keys are strings, so use sprintf if you get them from variables, or you're going to get strange results.