NiceSlice(3pm)
π NiceSlice(3pm) π
okay bestie, so this is a Perl manual page β NiceSlice(3pm) β and no, it's not about your skincare routine, it's about making PDL array slicing not look like a crime scene. let's get into it π«Ά
β¨ NAME β¨
PDL::Perldl2::Plugin::NiceSlice β literally just here to turn on the PDL NiceSlice syntax. that's the whole job. slay.
πΈ DESCRIPTION πΈ
so the way that this works is: this plugin lets you use the PDL::NiceSlice syntax inside an instance of Devel::REPL β you know, like the new Perldl2 shell, pdl2. π
and listen, without the plugin? array slicing looks like this tragedy:
pdl> use PDL;
pdl> $x = sequence(10);
$PDL1 = [0 1 2 3 4 5 6 7 8 9];
pdl> $x->slice("2:9:2");
$PDL1 = [2 4 6 8];
so many arrows. so many quotes. it's giving β¨effortβ¨ π
but AFTER the NiceSlice plugin has been loaded?? you get to write this instead:
pdl> $x(2:9:2)
$PDL1 = [2 4 6 8];
same result. zero vibes ruined. main character energy fr fr π
β οΈ CAVEATS β οΈ
okay so important one, bestie β don't skip this part π¨
PDL::NiceSlice uses Perl source preprocessing. so if you need 100% pure Perl compatibility, use the slice method instead. no cap. that's the deal.
π SEE ALSO π
PDL::NiceSliceDevel::REPLPDL::Perldl
go read those too, iykyk πβ¨
π AUTHOR π
Chris Marshall, <chm at cpan dot org> β iconic behavior, we stan π
π¦ COPYRIGHT AND LICENSE π¦
Copyright (C) 2010 by Christopher Marshall
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page!! π this was rendered with perl v5.38.2, dated 2024-04-10, and it's the NiceSlice(3pm) page β mwah, go slice some arrays, bestie ππ«ΆπΈ
π¦ where this page comes from
- ubuntu noble: pdl 1:2.085-1ubuntu1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms