This is somewhat basic so I apologise if this has been answered somewhere, but I had difficulty in finding the solution using some simple searches. Regardless, my problem is that I'm having a conflict in using 'PDL::index' and Perl's 'index'. Basically I have a script that is using predominantly PDL coding but I'd like to take advantage of Perl's index function, something like this:
use PDL; ... (a bunch of PDL lines of code) ...; $tmpsub = substr( $perlstr , index( $perlstr , /myregex/ ) , $position );
The problem with the above line is that it attempts to use PDL::Index. I have tried to the following as a solution:
use PDL; ... (a bunch of PDL lines of code) ...; $tmpsub = substr( $perlstr , $main::index( $perlstr , /myregex/ ) , $position );
But this fails because of my lack of understanding.
Basically I would like to use Perl's main 'index' function in the above line and not PDL's 'index'.
Hopefully this is a straightforward solution, and that I will not receive too much bludgeoning for having asked such a trivial question.