in reply to How to get data to an array?

The line you're likely looking for:

my @data = split(',',$input_buffer);

In context:

#!/usr/bin/perl use strict; use warnings; my @histofeld = (); open my $input_file, '<', 'test.dat' or die "$!"; while (my $input_buffer = <$input_file>) { chomp $input_buffer; my @data = split(',',$input_buffer); push @histofeld, @data; } close $input_file;

Replies are listed 'Best First'.
Re^2: How to get data to an array?
by thanos1983 (Parson) on Sep 01, 2017 at 00:22 UTC

    Hello dbander,

    Your solution unfortunately puts all data into the array. The OP will not be able to differentiate the data in order to create separate graphs.

    Sample of code and output:

    You should do something like that:

    Hope this helps, BR.

    Seeking for Perl wisdom...on the process of learning...not there...yet!
      Hello!

      Thank you all very much.

      push @histofeld, [split ',', $tmp[$i]];
      This get it work. :)

      Regards, buchi