http://qs1969.pair.com?node_id=407489


in reply to array assignment

PDL and Math::Matrix can do that:

use Math::Matrix; my $x = new Math::Matrix ( [1,2,3] ); my $y = new Math::Matrix ( [4,5,6] ); $result = $x->add( $y ); print $result; # 5.00000 7.00000 9.00000

Replies are listed 'Best First'.
Re^2: array assignment
by etj (Deacon) on Jun 22, 2022 at 19:57 UTC
    To spell out the PDL version of that (I find it prettier, but I may be biased):
    use PDL; my $x = pdl [1,2,3]; my $y = pdl [4,5,6]; print $x + $y; # [5 7 9]