in reply to Re: question to a complex structure of hash/array
in thread question to a complex structure of hash/array

> push an array

push @results, @array; extends @results by the elements of @array, it doesn't "push an array", as all the elements of an array must be scalars. You can push an array reference, though:

push @results, \@array;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: question to a complex structure of hash/array
by buchi2 (Acolyte) on Aug 09, 2017 at 04:28 UTC
    Hello!

    Thanx to all. I will try to give a running code.

    With the dumper there is the problem, that are some hundret values.
    ydata => $fnfeld[$ploty[$ii]]->{'fn'},
    This call to gnuplot is working.
    But this not:
    push @{$plotx{$ii}}, $fnfeld[$xfeld[$i]]->{'fn'}; . . . xdata => $plotx{$ii},
    It is empty.
    I will try to create a short standalone code.

    Regards buchi

Re^3: question to a complex structure of hash/array
by buchi2 (Acolyte) on Aug 09, 2017 at 07:55 UTC
    Hello!

    >push @results, @array; extends @results by the elements of @array, it doesn't "push an array", as all the elements of an array must be scalars. You can push an array reference, though:

    yes, thanks, so to getting it keep as an array, I push it to a hash.

    e.g.
    my %plotx; my $i; my @xfix; push @{$plotx{$i}}, @xfix;
    Regards, buchi
      Hello!

      Putting the whole data, it is to much data. I think, I will resign the fight at this construction area and will make a workaround, that I will print out the data from the array, which contains a hash, which contains an array element by element and the read it into the new array, which is part of a hash.

      Regards, buchi