Click here to get back home

activestate's Tcl.pm question

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
activestate's Tcl.pm question ~greg 03-03-2008
Posted by ~greg on March 3, 2008, 2:51 pm
Please log in for more thread options
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 want to know what ::auto_path is because
I am trying to insure that Tcl.pm uses Tcl/tk
instead of tkkit.dll.

thanks, if you can help,
(or if you're in Texas|Ohio and vote for Barack)

~greg





Posted by Janwillem Borleffs on April 1, 2008, 7:54 am
Please log in for more thread options
~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");


JW

Posted by ~greg on April 4, 2008, 12:33 am
Please log in for more thread options

> ~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


















Posted by ~greg on April 4, 2008, 12:40 am
Please log in for more thread options
correction --
> If you
> print 'puts $auto_path';
> in perl, you'd simply get
> puts $auto_path.



Similar ThreadsPosted
DBI question November 5, 2004, 4:28 pm
Newbie Question January 3, 2005, 4:11 pm
LWP question on windows98 October 7, 2004, 8:19 pm
Question to WIN32::OLE October 14, 2004, 11:34 am
Simple question September 15, 2005, 4:17 am
Getopt::Std question September 7, 2005, 9:42 am
Question regarding databases.. November 18, 2005, 9:41 am
Module Question October 25, 2004, 11:42 am
A question of name space October 31, 2004, 2:55 pm
Mechanize question November 8, 2004, 10:57 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap