Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks, I have a Little question for you and I hope you can help me. I have a hash, which Looks like this:
VAR1 = 'key' => { 'individual name' = > [ [coordinates], [Rotation], [ +height]] }
I need to know, how I can Access to the coordinates, the Rotation and height and how to save them in an Array or a scalar variable. I'm looking Forward to every Kind of help. Regards

Replies are listed 'Best First'.
Re: How to access hash and push it in scalar variable
by Athanasius (Archbishop) on Sep 16, 2014 at 06:41 UTC

    This should get you started:

    #! perl use strict; use warnings; my %hash = ( key => {'individual name' => [['coordinates'], ['Rotation'], ['hei +ght']]}, ); my $coords = $hash{key}->{'individual name'}[0][0]; my $rotation = $hash{key}->{'individual name'}[1][0]; my $height = $hash{key}->{'individual name'}[2][0]; print "$_\n" for ($coords, $rotation, $height);

    Output:

    16:38 >perl 1014_SoPW.pl coordinates Rotation height 16:38 >

    See perlreftut.

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      thank you a lot. works perfektly for me!!