Is it possible to perform a regular expression on a n-dimension PDL
variable?
For example I can add 100 to all the elements by doing
$a1 = pdl [1,2];
print $a1 + 100;
However what if my array was a bunch of strings that I would like to perform some task on. For example this fails:
$a = pdl ['suze','david'];
$a =~ s/suze/female/;
print $a;
Not sure if this is even possible, but thanks in advance.
The point is, that
PDL
is a perl extension that is designed for scientific and bulk numeric data processing and display. So its really not made for String manipulating. When you try to iterate through a piddle:You will get:
When you take a deeper look into the POD, you will find:
For the constructor and the followed text for
STRING
Back to your main problem, why do you use
PDL
for strings? - Why not using a simple Array?Output: