in reply to Pushing rows of data into array
use strict; use warnings; use Data::Dumper; my @headers = split /\s/, <DATA>; print Dumper \@headers; my $length = @headers; my @all; while (my $line = <DATA>){ my $row = [split /\s/, $line, $length]; push @all, $row; } print Dumper \@all; __DATA__ col1 col2 col3 col4 a b c d 1 2 3 4
|
|---|