f



Using Tcl::Tk Module with Tcl/Tk 8.5

Not sure if this is the right place for this question, as it is with
relation to the Tcl::Tk module, rather than Perl/Tk specifically.

I'd like to use Tcl::Tk with Tcl/Tk 8.5 rather than 8.4. To that end,
on a clean Debian Testing system I have installed only Tcl/Tk 8.5 and
also finally managed to install the Tcl::Tk module.

I was having problems installing the Tcl-0.95 module, which Tcl::Tk
depends on, but fixed it with a specific include path call:

>sudo perl Makefile.PL --tclsh /usr/bin/tclsh8.5 --tclconfig /usr/lib/tcl8.5/tclConfig.sh --include /usr/include/tcl8.5

Following on from this Tcl::Tk also then installed without error.

However, now my Perl script fails to execute. The error I receive is:

String found where operator expected at
/usr/local/share/perl/5.10.0/Tcl/Tk.pm line 575, near
"Carp::croak 'Usage: $interp = new Tcl::Tk($display)'"
(Do you need to predeclare Carp::croak?)
syntax error at /usr/local/share/perl/5.10.0/Tcl/Tk.pm
line 575, near "Carp::croak 'Usage: $interp = new
Tcl::Tk($display)'"
BEGIN not safe after errors--compilation aborted at
/usr/local/share/perl/5.10.0/Tcl/Tk.pm line 700.
Compilation failed in require at vidcap.pl line 3.
BEGIN failed--compilation aborted at vidcap.pl line 3.

Not sure what to do here. I've had a look at line 575 in Tk.pm for
obvious errors. There actually was not a semicolon at the end of that
line. I added one, but the error just changed to:

String found where operator expected at /usr/local/share/perl/5.10.0/
Tcl/Tk.pm line 576, near "Carp::croak 'Usage: $interp = new
Tcl::Tk([$display])'"
	(Do you need to predeclare Carp::croak?)
syntax error at /usr/local/share/perl/5.10.0/Tcl/Tk.pm line 576, near
"Carp::croak 'Usage: $interp = new Tcl::Tk([$display])'"
BEGIN not safe after errors--compilation aborted at /usr/local/share/
perl/5.10.0/Tcl/Tk.pm line 701.
Compilation failed in require at vidcap.pl line 3.
BEGIN failed--compilation aborted at vidcap.pl line 3.

Any ideas would be most appreciated, because frankly I have none.

0
PhillC
5/20/2008 9:51:20 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

5 Replies
1304 Views

Similar Articles

[PageSpeed] 23

PhillC wrote:
> Not sure if this is the right place for this question, as it is with
> relation to the Tcl::Tk module, rather than Perl/Tk specifically.
> 
> I'd like to use Tcl::Tk with Tcl/Tk 8.5 rather than 8.4. To that end,
> on a clean Debian Testing system I have installed only Tcl/Tk 8.5 and
> also finally managed to install the Tcl::Tk module.
> 
> I was having problems installing the Tcl-0.95 module, which Tcl::Tk
> depends on, but fixed it with a specific include path call:
> 
> 
>>sudo perl Makefile.PL --tclsh /usr/bin/tclsh8.5 --tclconfig /usr/lib/tcl8.5/tclConfig.sh --include /usr/include/tcl8.5
> 
> 
> Following on from this Tcl::Tk also then installed without error.
> 
> However, now my Perl script fails to execute. The error I receive is:
> 
> String found where operator expected at
> /usr/local/share/perl/5.10.0/Tcl/Tk.pm line 575, near
> "Carp::croak 'Usage: $interp = new Tcl::Tk($display)'"
> (Do you need to predeclare Carp::croak?)
> syntax error at /usr/local/share/perl/5.10.0/Tcl/Tk.pm
> line 575, near "Carp::croak 'Usage: $interp = new
> Tcl::Tk($display)'"
> BEGIN not safe after errors--compilation aborted at
> /usr/local/share/perl/5.10.0/Tcl/Tk.pm line 700.
> Compilation failed in require at vidcap.pl line 3.
> BEGIN failed--compilation aborted at vidcap.pl line 3.
> 
> Not sure what to do here. I've had a look at line 575 in Tk.pm for
> obvious errors. There actually was not a semicolon at the end of that
> line. I added one, but the error just changed to:
> 
> String found where operator expected at /usr/local/share/perl/5.10.0/
> Tcl/Tk.pm line 576, near "Carp::croak 'Usage: $interp = new
> Tcl::Tk([$display])'"
> 	(Do you need to predeclare Carp::croak?)
> syntax error at /usr/local/share/perl/5.10.0/Tcl/Tk.pm line 576, near
> "Carp::croak 'Usage: $interp = new Tcl::Tk([$display])'"
> BEGIN not safe after errors--compilation aborted at /usr/local/share/
> perl/5.10.0/Tcl/Tk.pm line 701.
> Compilation failed in require at vidcap.pl line 3.
> BEGIN failed--compilation aborted at vidcap.pl line 3.
> 
> Any ideas would be most appreciated, because frankly I have none.
> 


Sounds like Tk.pm is missing a "use Carp;" statement.
** Posted from http://www.teranews.com **
0
smallpond
5/21/2008 2:39:11 PM
On 21 May, 15:39, smallpond <smallp...@juno.com> wrote:
> Sounds like Tk.pm is missing a "use Carp;" statement.
>

Adding use Carp; to Tk.pm results in the following:

Can't locate Carp/croak.pm in @INC (@INC contains: /etc/perl /usr/
local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/
share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/
site_perl .) at vidcap.pl line 5.
BEGIN failed--compilation aborted at vidcap.pl line 5.

Perhaps there's something wrong with my Perl installation. However,
removing and then re-installing effects too many dependencies. Any
further ideas?



0
PhillC
5/22/2008 7:00:01 PM
PhillC wrote:
> On 21 May, 15:39, smallpond <smallp...@juno.com> wrote:
> 
>>Sounds like Tk.pm is missing a "use Carp;" statement.
>>
> 
> 
> Adding use Carp; to Tk.pm results in the following:
> 
> Can't locate Carp/croak.pm in @INC (@INC contains: /etc/perl /usr/
> local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/
> share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/
> site_perl .) at vidcap.pl line 5.
> BEGIN failed--compilation aborted at vidcap.pl line 5.
> 
> Perhaps there's something wrong with my Perl installation. However,
> removing and then re-installing effects too many dependencies. Any
> further ideas?
> 
> 
> 

I'm guessing from the error messages that Carp.pm is an empty file or
not readable.  What type of system are you on and how did you install perl?
--S
** Posted from http://www.teranews.com **
0
smallpond
5/22/2008 8:48:15 PM
On 22 May, 21:48, smallpond <smallp...@juno.com> wrote:
> PhillC wrote:
> > On 21 May, 15:39, smallpond <smallp...@juno.com> wrote:
>
> >>Sounds like Tk.pm is missing a "use Carp;" statement.
>
> > Adding use Carp; to Tk.pm results in the following:
>
> > Can't locate Carp/croak.pm in @INC (@INC contains: /etc/perl /usr/
> > local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/
> > share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/
> > site_perl .) at vidcap.pl line 5.
> > BEGIN failed--compilation aborted at vidcap.pl line 5.
>
> > Perhaps there's something wrong with my Perl installation. However,
> > removing and then re-installing effects too many dependencies. Any
> > further ideas?
>
> I'm guessing from the error messages that Carp.pm is an empty file or
> not readable.  What type of system are you on and how did you install perl?
> --S

I'm on Debian Lenny and Perl was installed during the distribution
install. I haven't installed Perl manually.


0
PhillC
5/28/2008 8:44:11 PM
On 28 May, 21:44, PhillC <phillcla...@gmail.com> wrote:
> On 22 May, 21:48, smallpond <smallp...@juno.com> wrote:
>
>
>
> > PhillC wrote:
> > > On 21 May, 15:39, smallpond <smallp...@juno.com> wrote:
>
> > >>Sounds like Tk.pm is missing a "use Carp;" statement.
>
> > > Adding use Carp; to Tk.pm results in the following:
>
> > > Can't locate Carp/croak.pm in @INC (@INC contains: /etc/perl /usr/
> > > local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr=
/
> > > share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/
> > > site_perl .) at vidcap.pl line 5.
> > > BEGIN failed--compilation aborted at vidcap.pl line 5.
>
> > > Perhaps there's something wrong with my Perl installation. However,
> > > removing and then re-installing effects too many dependencies. Any
> > > further ideas?
>
> > I'm guessing from the error messages that Carp.pm is an empty file or
> > not readable. =A0What type of system are you on and how did you install =
perl?
> > --S
>
> I'm on Debian Lenny and Perl was installed during the distribution
> install. I haven't installed Perl manually.


            I have found the solution to this after much Googling. It
doesn't make sense, but everything now works.

            Answer is on this page:

            http://search.cpan.org/src/TLINDEN/Config-General-2.31/General.p=
m

            Specific text is:

            # on debian with perl > 5.8.4 croak() doesn't work anymore
without this.
            # There is some require statement which dies 'cause it
can't find Carp::Heavy,
            # I really don't understand, what the hell they made, but
the debian perl
            # installation is definetly bullshit, damn!
            use Carp::Heavy;

            Not sure why this works, but my application now launches.
seems like the necessary modules were installed but something else is
not right.
0
PhillC
6/3/2008 4:08:28 PM
Reply: