ALBD
view release on metacpan or search on metacpan
utils/datasetCreator/makeOrderNotMatter.pl view on Meta::CPAN
#input checking
(exists $options{'inputFile'}) or die ("inputFile must be specified\n");
open IN, $options{'inputFile'} or
die ("unable to open input file: $options{inputFile}\n");
(exists $options{'outputFile'}) or die ("outputFile must be specified\n");
open OUT, '>'.$options{'outputFile'} or
die ("unable to open output file: $options{outputFile}\n");
#make order not matter
#...output every $outputLimit iterations to avoid too much IO
my %matrix = ();
while (my $line = <IN>) {
#TODO use split instead of regex match
$line =~ /([^\s]+)\t([^\s]+)\t([^\s]+)/;
#$1 = row, $2 = col, $3 = val
if (!(defined $1) || !(defined $2) || !(defined $3)) {
print "Not all defined: $line";
}
( run in 0.526 second using v1.01-cache-2.11-cpan-71847e10f99 )