bk_2 has asked for the wisdom of the Perl Monks concerning the following question:

One of the users I support gets an error when he runs a script with the first line "use Tk;". None of the others suffers the same problem. The error is:

e:/Rational/Common/lib/perl5/site_perl/5.8.6/MSWin32-x86-multi-thread/ +auto/Tk/getEncoding.al did not return a true value at e:/Rational/Com +mon/lib/perl5/5.8.6/MSWin32-x86-multi-thread/DynaLoader.pm line 253 Compilation failed in require at S:\setCCVIEW.pl line 1. BEGIN failed--compilation aborted at S:\setCCVIEW.pl line 1.

getEncoding.al has a last (non-comment) line of 1; so it always returns a true value to a use or require. Although I can't see the dependency chain from use Tk; to getEncoding.al, I don't see how getEncoding.al can return anything but 1 in this compilation stage.

Can anyone spot the problem?

Replies are listed 'Best First'.
Re: use Tk; fails
by Anonymous Monk on Dec 09, 2011 at 04:47 UTC

    Can anyone spot the problem?

    Impossible :) there is nothing to examine (no test-case, no Tk version information, nothing) but a non-reproducible error message...

    Most likely the problem is 5.8.6, that is down right antique

Re: use Tk; fails
by sumeetgrover (Monk) on Dec 09, 2011 at 08:00 UTC

    You haven't posted the full error message, but from what you have provided, a possibility might be that perl can't find Tk.pm in the library paths stored in the @INC array.

    Your error message indicates that perl has printed out contents of @INC to notify that none of these library paths contained Tk.pm

      Hi, there is no possibility of that, the error message would be of the form
      $ perl -MSumeet -e 1 Can't locate Sumeet.pm in @INC (@INC contains ...

        Thanks for pointing this out. You're right. The error message posted on this question was tiny enough that I found it hard to read...