activestate's question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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 ...\ line 4.

I want to know what ::auto_path is because
I am trying to insure that uses Tcl/tk
instead of tkkit.dll.

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


Re: activestate's question

~greg schreef:
Quoted text here. Click to load it

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");


Re: activestate's question

Quoted text here. Click to load it

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
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 to use Activestate's Tcl/Tk
installation instead of the tkkit.dll that they ship with
(If you follow me. But don't worry if you don't. This is not a very popular

I only mentioned because I knew that uses,
so I thought it'd be easiest (or necessary) to get 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
... 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
(,, Tcl/Tk, tkkit.dll) are actually hooked up.


Re: activestate's question

correction --
Quoted text here. Click to load it


Site Timeline