in reply to Is it possible to get the inverse of a square matrix to be input as a text file using STDIN?
One of the things to learn about any programming language is that your problem has almost certainly been addressed in some way before, and in this case there are PERL CPAN libraries like Math::Matrix and Math::MatrixReal to avoid having to do any work. Using CPAN libraries also makes your code more maintainable as other people will have more chance of having come across the library concerned on CPAN than of understanding your custom code.
e.g.
In answer to the input question, (and modifying an earlier answer) why not get your input as
and then your script can get your input from any file or stdin....while (<>) do { push @m2, [ split /,/, $_ ]; }
e.g.
./myprogram.pl < d1.txt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is it possible to get the inverse of a square matrix to be input as a text file using STDIN?
by supriyoch_2008 (Monk) on Nov 09, 2012 at 04:36 UTC |
In Section
Seekers of Perl Wisdom