in reply to perl index function error when "use PDL"

Thanks to all Monks who offered suggestions to solve my problem.

I appreciated especially Lotus1's example code.

I just replaced  my $pos4 = index($test,"test"); with  my $pos4 = CORE::index($test,"test"); and everything is fine now.

I thought that my problem was related to perl trying to use some piddle index method, but was not aware of using CORE to refer back to a perl core function. Thanks again to all!