Re: activestate's Tcl.pm question
- From: "~greg" <g_m@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Apr 2008 00:33:13 -0400
"Janwillem Borleffs" <jw@xxxxxxxxxxxxx> wrote in message news:47f22266$0$3012$dbd4d001@xxxxxxxxxxxxxxx
~greg schreef:this ...
use Tcl;
my $Interpreter = new Tcl;
$Interpreter->Eval('puts "Hello world"');
$Interpreter->Eval('puts $auto_path');
puts this ...
Hello world
can't read "auto_path": no such variable at ...\test.pl line 4.
I have never used this module, but it seems that the problem is related to the use of single quotes; try instead:
$Interpreter->Eval("puts $auto_path");
No. But thank you anyway.
~~
It's tcl syntax in that Eval(), not perl syntax.
If you think about it, perl wouldn't call that kind of error.
If you print 'puts $auto_path'; in perl, you'd simply get
$auto_path.
because Perl doesn't interpolate variables in single quotes.
Like perl, tcl also uses '$' for variables (but only to get the value (R-side), and not for setting it (L-side)).
This, for example, works fine: ... use Tcl;
my $Interpreter = new Tcl;
$Interpreter->Eval('set x "Hello world"');
$Interpreter->Eval('puts $x');
It prints
Hello world
~~
Actually what I wanted was to get Tkx.pm to use Activestate's Tcl/Tk
installation instead of the tkkit.dll that they ship with Tkx.pm
(If you follow me. But don't worry if you don't. This is not a very popular subject.)
I only mentioned Tcl.pm because I knew that Tkx.pm uses Tcl.pm, so I thought it'd be easiest (or necessary) to get Tcl.pm to use Tcl/Tk first.
And I did finally get Tkx to use Tcl/Tk,
(in the sense that
use Tkx;
print join "\n", (Tkx::SplitList(Tkx::set('auto_path')));
now prints out
C:/Tcl/lib/tcl8.5
.... etc )
However, trying it again, I still can't get use Tcl;
my $Interpreter = new Tcl;
$Interpreter->Eval('puts $auto_path');
to print anything but:
can't read "auto_path": no such variable at ...
Which means I don't really understand how these things
(Tkx.pm, Tcl.pm, Tcl/Tk, tkkit.dll) are actually hooked up.
~greg
.
- Follow-Ups:
- Re: activestate's Tcl.pm question
- From: ~greg
- Re: activestate's Tcl.pm question
- References:
- Re: activestate's Tcl.pm question
- From: Janwillem Borleffs
- Re: activestate's Tcl.pm question
- Prev by Date: Re: write a new module for suffix trees?
- Next by Date: Re: activestate's Tcl.pm question
- Previous by thread: Re: activestate's Tcl.pm question
- Next by thread: Re: activestate's Tcl.pm question
- Index(es):
Relevant Pages
|
|