in reply to Re^3: matrices and non-numerical values
in thread matrices and non-numerical values
I revised the code some more according to what makes sense. And I get errors regarding uninitialized values @values and @elements in hash element at each line of the file, list.txt.
use strict; use warnings; open(IN, "list.txt") or die; chomp($line = <IN>); ($element, @abc) = split /\s+/, $line; while (chomp($line = <IN>)) { ($values, @xyz) = split /\s+/, $line; for ($i=0; $i<@xyz; $i++) { $s {$elements}{$values[$i]} = $xyz[$i]; } } close(IN);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: matrices and non-numerical values
by GrandFather (Saint) on Apr 30, 2012 at 02:09 UTC |