1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Perl/Tk problem with TCC (13&14)

Discussion in 'Support' started by David McClelland, Mar 17, 2013.

  1. David McClelland

    Joined:
    Jun 4, 2008
    Messages:
    19
    Likes Received:
    0
    The problem is not with actually executing Tk in perl program but just including it. Here is the perl program:

    t0.pl is 'print "Hello Word\n";'

    In TCC type in "t0" and you get "Hello World". Do it again an the same thing. As expected.

    Now add a line:
    use Tk;
    print "Hello World\n";

    Open a new tab and type "t0" and you get "Hello World". Type it in again you get nothing.

    Close the tab, open a new one and repeat the sequence. You will get "Hello World" the first time and nothing after that. Type in 'perl t0.pl' and you get "Hello World" every time.

    Any solution?

    David
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    Are you using the internal Perl support in TCC (i.e., did you check the box in OPTION / Startup / Scripting / Perl)? If not, this has nothing to do with TCC.

    If you did, then you still need to have installed PerlScript (the WSH COM interface). If you didn't, it doesn't have anything to do with TCC.

    If you did enabled internal Perl support in TCC and installed PerlScript, then ... it still doesn't have anything to do with TCC. TCC simply invokes PerlScript with the specified script file name and arguments. You'll need to take this up with the developers of the PerlScript / Tcl version you are using.
     
  3. David McClelland

    Joined:
    Jun 4, 2008
    Messages:
    19
    Likes Received:
    0
    Well maybe. There is another wrinkle: I invoked the program repeatedly and got the following results:
    #1 - Hello World
    #2 to #6 - nothing displayed
    #7 to ?? Hello World

    Also this behaviour only happens on the first set of executions after opening a new tab. I don't know if Perl.exe closes after each execution but if it does the it seems to me that TCC is the only thing that could be maintaining some artifact that would cause this behaviour on subsequent execution.

    I could be mistaken but since I don't know the internals of TCC nor of Perl/Tk the only workaround is the use "perl script.pl" instead of "script.pl" on the command line. Not really a big deal.

    David
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    TCC definitely does not do *anything* to maintain a persistent interpreter. It just calls the WSH active scripting Perl interpreter -- if somebody is maintaining artifacts it would have to be either WSH or the Perl active script.

    Previously, TCC did maintain a persistent Perl interpreter and executed Perl scripts by calling the Perl dll's directly. But I had to abandon that because of numerous (and increasing) fatal errors in the embedded Perl code for Windows. (The Perl developers obviously don't spend much time either coding or testing for the Windows environment.)
     

Share This Page