In 4.0, searchDataDir() is gone, replaced by initSearchDirectories().
Call the latter if available, else fall back to the former.
eval q{use highlight};
if (highlight::DataDir->can('new')) {
$data_dir=new highlight::DataDir();
eval q{use highlight};
if (highlight::DataDir->can('new')) {
$data_dir=new highlight::DataDir();
- $data_dir->searchDataDir("");
+ if ( $data_dir->can('initSearchDirectories') ) {
+ # 4.0+
+ $data_dir -> initSearchDirectories("");
+ } else {
+ # pre-4.0
+ $data_dir -> searchDataDir("");
+ }
} else {
$data_dir=undef;
}
} else {
$data_dir=undef;
}