Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

Tcl module error

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


ajs at OpenMarket

Sep 19, 1995, 7:08 AM

Post #1 of 2 (95 views)
Permalink
Tcl module error

I just got Tcl-b1, and compiled it against the version of TCL that I
have. It seems to work, but fails to do anything with a command line
like:

./perl -I blib -le 'use Tcl;($t=new Tcl)->Init();$t->GlobalEval("puts stdout {Hello world}")'

This is perl5.001m on BSDI 2.0 and a statically linked version of Tcl.

Another odd thing is the effect of calling a non-existant proc:

./perl -I blib -le 'use Tcl;($t=new Tcl)->Init();$t->GlobalEval("aaa")'

Yields:

can't read "tcl_interactive": no such variable at -e line 1.

Huh?

-AJS


--
Aaron Sherman <ajs [at] ajs> B4 f w+ c kv s+(--)v r p
I-Kinetics, Inc. Pager: (508)545-0584
1 NE Executive Park Fax: (617)270-4979
Burlington, MA 01803-5005 WWW: http://ajs.com/~ajs/
ajs [at] ajs or ajs [at] openmarket
"I speak for no one."


mbeattie at sable

Sep 19, 1995, 12:01 PM

Post #2 of 2 (89 views)
Permalink
Re: Tcl module error [In reply to]

Aaron Sherman writes:
> I just got Tcl-b1, and compiled it against the version of TCL that I
> have. It seems to work, but fails to do anything with a command line
> like:
>
> ./perl -I blib -le 'use Tcl;($t=new Tcl)->Init();$t->GlobalEval("puts stdout {Hello world}")'
>
> This is perl5.001m on BSDI 2.0 and a statically linked version of Tcl.

It works fine for me (with or without the $t->Init() which does
Tcl_Init on the interpreter) under OSF/1 3.2c with perl5.001m
and Tcl 7.3. What version of libtcl are you using? I know 7.3
isn't the latest but I don't have a later one to test. Can anyone
else reproduce the problem? I get

% perl -le 'use Tcl;($t=new Tcl)->Init();$t->GlobalEval("puts stdout {Hello world}")'
Hello world
% perl -le 'require Tcl; $t = new Tcl; $a = $t->Eval("expr {2 + 3}"); print $a'
5

> Another odd thing is the effect of calling a non-existant proc:
>
> ./perl -I blib -le 'use Tcl;($t=new Tcl)->Init();$t->GlobalEval("aaa")'
>
> Yields:
>
> can't read "tcl_interactive": no such variable at -e line 1.
>
> Huh?

Doing
perl -le 'use Tcl;$t=new Tcl;$t->GlobalEval("aaa")'
gives
invalid command name: "aaa" at -e line 1.

When you do the $t->Init(), I suspect that the Tcl initialisation
script does clever things so that unknown commands are searched
for as shell commands or autoloaded--but only if you're using Tcl
interactively (tclsh or similar). The Tcl module doesn't initialise
some of the stuff that tclsh ans so on do and I expect the
tcl_interactive variable is expected to be set.

--Malcolm

--
Malcolm Beattie <mbeattie [at] sable>
Unix Systems Programmer
Oxford University Computing Services

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.