in reply to Re: Matrix Manipulation with Perl
in thread Matrix Manipulation with Perl

So I went and installed Math::Matrix, which does matrices ok, except I could not find a way to do an inverse (which I really really need) even though it said as the header for the documentation it could do inversion, but there was no routine for it.

So then I decided to try the PDL because it said that it could do inversion and actually had a command called "inv" listed. I got PDL::Matrix and PDL::MatrixOps modules loaded up,

root@admin PDL-2.4.2# perl -MPDL::Matrix -e shell
root@admin PDL-2.4.2# perl -MPDL::MatrixOps -e shell
root@admin PDL-2.4.2#

but when I tried to run a simple program to confirm it was working I got this error:

Can't locate object method "xchg" via package "PDL::Matrix" at /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/PDL/Matrix.pm line 137.

I am now lost. I do not know what this means except that there might be some module that I need loaded that I forgot to load. Any ideas?

Chris Herold

Replies are listed 'Best First'.
Re^3: Matrix Manipulation with Perl
by etj (Priest) on Jun 22, 2022 at 18:55 UTC
    The above does not "get modules loaded up". It runs two Perl processes each of which load a given module, try to execute the string "shell" (which will evaluate to a string, doing nothing), then exit.

    Instead, the way forward is to run either perldl or pdl2 on the command line, which will load the PDL REPL. It has builtin help, and there is also the MetaCPAN page: https://metacpan.org/pod/perldl.

Re^3: Matrix Manipulation with Perl
by Tanktalus (Canon) on Jun 30, 2005 at 04:06 UTC

    Not that I know anything about PDL at all, but seeing as no one else has responded: can you pare down the simple program to show the error with as few lines as is reasonably possible? That way I could go and install this stuff here and try it out, for example. Or someone else might beat me to it <crossing fingers> ;-)