in reply to Appending arrays into the rows of a 2 dimension array
#!/usr/bin/perl -w use strict; use warnings; use v5.10; my $completeDataPtRef; for my $slot (1 .. 2) { my $TestFileName = "Slot". $slot ."Simplex.cfg.data"; open my $dataFile, '<', "$TestFileName" or die ("Unable to open +file $TestFileName: $!\n"); my $dataSetCnt = 0; while (my $dataLine = <$dataFile>) { $dataLine =~ /^#/ and next; my @dataPts = split(/\s+/, $dataLine); my $dataSetSize = shift(@dataPts); my $totalThroughput = shift(@dataPts); push @{$completeDataPtRef->[$dataSetCnt]}, @dataPts; ++$dataSetCnt; } close $dataFile; } for my $linevalues (@{$completeDataPtRef}) { print "@{$linevalues}\n"; }
|
|---|