in reply to Re^4: matrices and non-numerical values
in thread matrices and non-numerical values

You did not run the code you show us or you would have gotten messages that look like:

lobal symbol "$line" requires explicit package name at noname.pl line +5. Global symbol "$element" requires explicit package name at noname.pl l +ine 6. ...

Prefix your code with:

use strict; use warnings; my $fname = 'list.txt'; open my $fOut, '>', $fname or die "Can't create $fname: $!\n"; print $fOut <<TESTDATA; some test data goes here TESTDATA close $fOut; ...

providing some sensible test data where indicated then show us the result of actually running the code.

True laziness is hard work