2

I have Debian GNU/Linux trixie/sid and I installed publican from repo of debian. (publican is doing write and publish for DocBook)
When I run publican , It get the following messages:

Attempt to call undefined import method with arguments ("abs2rel") via package "File::Spec" (Perhaps you forgot to load the package?) at /usr/share/perl5/Publican/TreeView.pm line 12.
Duplicate specification "help" for option "help"
Can't open publican: No such file or directory at /usr/bin/publican line 646.

Version of my publican is 4.3.2-4.
Also I installed libfile-spec-native-perl package from repo.

Then I download source code via:

apt source publican

Then run publican and get the following error:

mohsen@debian:~/src-compiled/publican/publican-4.3.2/bin$ ./publican 
Attempt to call undefined import method with arguments ("abs2rel") via package "File::Spec" (Perhaps you forgot to load the package?) at /usr/share/perl5/Publican/TreeView.pm line 12.
Duplicate specification "help" for option "help"

Action required!

According to above Action Required! string added to output.

I don't know how do I solve it.
You make me happy if solved my problem.

1 Answer 1

4

The message "Attempt to call undefined import method..." is a warning introduced in Perl 5.40.0 (see perl5400delta). Older Perl versions didn't show this warning.

Nevertheless, the warning is correct in this case. File::Spec uses object orientation and doesn't export anything. The code in publican should instead use File::Spec::Functions. It's possible that ancinet versions of File::Spec exported the functions directly, but I can't find such a version in Perl's git history, because the source files were moved to a different location over the years.

It seems publican is very old and is not kept up to date with Perl. You can try changing the line

use File::Spec qw(abs2rel);

to

use File::Spec::Functions qw(abs2rel);

but it's possible you'll encounter additional similar problems.

1
  • File::Spec 0.6 was added to the core from CPAN in 5.004_05; it allowed exporting a $Verbose flag. File::Spec 0.8 in 5.6.0 removed that, and the inheritance from Exporter. So there isn't any version where abs2rel would actually have been exported, but since there was no import method, it silently did nothing for perl >= 5.6.0 and < 5.40.0. Commented Jul 28 at 19:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.