Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 127529
Status: resolved
Priority: 0/
Queue: Tcl-pTk

People
Owner: CAC [...] cpan.org
Requestors: welleozean [...] googlemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.95



Subject: Tcl::pTk 0.94 Tk->findINC
Date: Tue, 30 Oct 2018 16:17:43 +0100
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle Ozean <welleozean [...] googlemail.com>
Calling "Tk->findINC('.')" in the following line fires an error in some circumstances: # Tcl::pTk::libary variable: Translation from perl/tk Tk.pm {($Tcl::pTk::library) = __FILE__ =~ /^(.*)\.pm$/;} $Tcl::pTk::library = Tk->findINC('.') unless (defined($Tcl::pTk::library) && -d $Tcl::pTk::library); I solved it (at least there are no complaints anymore) changing the line into, but I am not quite sure that this is a correct patch: $Tcl::pTk::library = findINC('.') unless (defined($Tcl::pTk::library) && -d $Tcl::pTk::library); Note that there is a subroutine findINC in the same pTk.pm
Hi Welle, I apologize for overlooking this report for so long.

This looks a lot like the issue in a thread I had encountered on PerlMonks: https://www.perlmonks.org/?node_id=1216767
 

I haven't encountered the error myself, but indeed it looks like there was a mistake: the third line should have been changed to use

Tcl::pTk->findINC('.')

when it was originally copied from Perl/Tk. Using just findINC without Tk-> as you've tried is likely equivalent, but I think using Tcl::pTk->findINC would be more consistent.

I'm not sure under what conditions exactly that $Tcl::pTk::library doesn't get set by the second line, causing the unless … condition to be false on the line below it and in turn the Can't locate object method error, but I'm guessing they happen infrequently.

I have committed a fix for this: 
https://github.com/chrstphrchvz/perl-tcl-ptk/commit/b31a9faed6cf303bce7378ba9194e2a95d2656f1

I am finally trying to wrap up the Tcl::pTk 0.95 release and upload that any day now.