in reply to perl index function error when "use PDL"
#!/usr/bin/perl -w use strict; use PDL::Core; use PDL::Index; use PDL::Basic; use PDL::Math; use PDL::Primitive; use PDL::Slices qw/!index/; # <-HERE is the problem (and the solution) use PDL::IO::FITS; my $test = "This is a test and I hope it works."; my $pos4 = index $test,"test"; print "pos4 = $pos4\n"; exit(0); __END__ pos4 = 10
Updated: In fact it was a little more complicated, really PDL::Index was not the culprit at the end, they are three different index here:
the perl function index a PDL function index in the module PDL::Slices (the real culprit) and a module named PDL::Index
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl index function error when "use PDL"
by syphilis (Archbishop) on Oct 28, 2011 at 01:34 UTC | |
by BrowserUk (Patriarch) on Oct 28, 2011 at 01:41 UTC | |
by syphilis (Archbishop) on Oct 28, 2011 at 03:05 UTC | |
by BrowserUk (Patriarch) on Oct 28, 2011 at 03:28 UTC |