From: Ahmad Zawawi

> Awesome. Please keep them coming. Do we have plans for Perl 6? :)

If you enjoy jumping through hoops you can access perl5's PDL from perl6:

####################################
sisyphus@sisyphus5-desktop:~/p6$ cat pdl.pl
use PDL::Core:from<Perl5>;
use PDL::Ops:from<Perl5>;
use PDL::Primitive:from<Perl5>;
use PDL::Ufunc:from<Perl5>;
use PDL::Basic:from<Perl5>;
use PDL::Slices:from<Perl5>;
use PDL::Bad:from<Perl5>;
use PDL::Lvalue:from<Perl5>;

my $x1 = [1, 2, 3];
my $y1 = [4, 5, 6];

my $x2 = [21, 22, 23];
my $y2 = [24, 25, 26];

my $m1 = pdl($x1, $y1);
my $m2 = pdl($x2, $y2);

say "$m1";
say "$m2";

# $m1 *= $m2; # Won't work - instead make the method call.
$m1.mult($m2, $m1, 0);

say "$m1";

sisyphus@sisyphus5-desktop:~/p6$ perl6 pdl.pl

[
[1 2 3]
[4 5 6]
]


[
[21 22 23]
[24 25 26]
]


[
[ 21  44  69]
[ 96 125 156]
]

sisyphus@sisyphus5-desktop:~/p6$
####################################

AFAIK this also requires that perl5 was built with the -Duseshrplib 
configure option .

Cheers,
Rob



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to