Executable extension problem 1

The way the command is invoked from an executable extension has changed between V10 and V11. Note that in Perl the variable $EXECUTABLE_NAME contains the name of the program that was used to invoke the currently running perl script as passed to the program via arguments. For the purposes of this test, the script config.pl is little more than:

use English;
print "\$
EXECUTABLE_NAME=$EXECUTABLE_NAME\n";

In V10, whether invoked from an executable extension (first case) or directly using perl (second case) the value passed is the file name of the perl interpreter.

>ver
TCC 10.00.76 Windows XP [Version 5.1.2600]
>\cmd\Config\Config.pl
$EXECUTABLE_NAME=C:\perl\bin\perl.exe
>perl \cmd\Config\Config.pl
$EXECUTABLE_NAME=C:\perl\bin\perl.exe

However in V11, for the executable extension it is 'TCC'.

>ver
TCC 11.00.31 Windows XP [Version 5.1.2600]
>\cmd\Config\Config.pl
$EXECUTABLE_NAME=TCC
>perl \cmd\Config\Config.pl
$EXECUTABLE_NAME=C:\perl\bin\perl.exe

This obviously revolves around how the arguments are passed to the Windows routine that starts processes (CreateProcess if I'm not mistaken). I need to have the name of the perl interpreter in some of my scripts to ensure that child scripts are invoked with the same version of the interpreter that was used for the parent script.
 
May 20, 2008
603
0
Sammamish, WA
>> I need to have the name of the perl interpreter in some of my scripts to ensure that child scripts are invoked with the same version of the interpreter that was used for the parent script.


> Not to suggest that what you report should be looked at, but have you
> looked into $PERL_VERSION ($^V) for your test instead of
> $EXECUTABLE_NAME?

After re-reading your post, I think you may be using that to invoke a
child script yourself. If that's true, my suggestion is obviously
void. Does "do EXPR" work for you?

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
May 20, 2008
603
0
Sammamish, WA
Not to suggest that what you report should be looked at, but have you
looked into $PERL_VERSION ($^V) for your test instead of
$EXECUTABLE_NAME?


2009/11/2 Péter Köves <>:

> The way the command is invoked from an executable extension has changed between V10 and V11. Note that in Perl the variable $EXECUTABLE_NAME contains the name of the program that was used to invoke the currently running perl script as passed to the program via arguments. For the purposes of this test, the script config.pl is little more than:
>
> use English;
> print "\$EXECUTABLE_NAME=$EXECUTABLE_NAME\n";
>
> In V10, whether invoked from an executable extension (first case) or directly using perl (second case) the value passed is the file name of the perl interpreter.
>
>>*ver*
> TCC *10.00.76 * Windows XP [Version 5.1.2600]
>>*\cmd\Config\Config.pl*
> $EXECUTABLE_NAME=C:\perl\bin\perl.exe
>>*perl *\cmd\Config\Config.pl*
> $EXECUTABLE_NAME=C:\perl\bin\perl.exe
>
> However in V11, for the executable extension it is 'TCC'.
>
>>*ver*
> TCC *11.00.31 * Windows XP [Version 5.1.2600]
>>*\cmd\Config\Config.pl*
> $EXECUTABLE_NAME=TCC
>>*perl \cmd\Config\Config.pl*
> $EXECUTABLE_NAME=C:\perl\bin\perl.exe
>
> This obviously revolves around how the arguments are passed to the Windows routine that starts processes (CreateProcess if I'm not mistaken). I need to have the name of the perl interpreter in some of my scripts to ensure that child scripts are invoked with the same version of the interpreter that was used for the parent script.
>
>
>
>
>
>



--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
After re-reading your post, I think you may be using that to invoke a
child script yourself. If that's true, my suggestion is obviously
void. Does "do EXPR" work for you?

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.

Basically the config.pl script is just an invoker that calls all perl scripts in a given directory whose names start with 'Config'.

I always forget about this form of 'do'. The other problem is that I'll also forget that the invoked scripts can't contain 'exit'-s (as they did now) and then it will take forever for me to figure out what is wrong. Otherwise it works with 'do'.
 
Basically the config.pl script is just an invoker that calls all perl scripts in a given directory whose names start with 'Config'.

I always forget about this form of 'do'. The other problem is that I'll also forget that the invoked scripts can't contain 'exit'-s (as they did now) and then it will take forever for me to figure out what is wrong. Otherwise it works with 'do'.

Turns out there is a solution for this after all that allows the exit-s to be left in place: override the built in definition!

use subs 'exit';
sub exit(;$) {}
 

rconn

Administrator
Staff member
May 14, 2008
12,312
147
> ---Quote (Originally by jabelli)---
> Configure TCC, turn off perl scripting, and restart TCC.
> ---End Quote---
> Amazing! That worked, but
>
> 1. Why? This wasn't required in V10 ...
> 2. What exactly do I loose by turning off perl scripting? %@perl[]
> still seems to work ...

Nothing changed in the executable extensions or Perl between v10 and v11; I
suspect your problem is due to TCMD.INI differences in the Perl options.

In regards to #2, what you lose is the ability to execute Perl scripts
within the TCC process. This is useful if you want to share variables
between Perl & TCC, but if your Perl scripts are stand-alone you won't lose
anything. (Other than Perl being slightly slower to start.)

Rex Conn
JP Software
 
Similar threads
Thread starter Title Forum Replies Date
P Executable extension problem 2 Support 0
Jay Sage Executable Extension with Lua Support 5
C V25 eats STDERR from executable extensions Support 8
David McClelland TCMD 24 & Perl - perl thinks it's own executable is ...\TCMD24\TCC.EXE??? Support 3
M How to set Path variable for non-executable file extensions in 4DOS Support 8
T TCHelp executable history? Support 2
Craig Fitzgerald problem with executable extensons with TCC version 19.10.51 x64 Support 3
E How to? use Executable Extensions: .bat and .cmd Support 8
W File completion without space/executable extensions Support 3
D Executable load errors suppressed Support 5
dcantor Executable file extensions in V10 b 38 Support 5
D Exclude extension from filename completion Support 1
A WAD Take Command ignoring my application-extension associations Support 19
G Find files but ignore file extension in search Support 2
G Use extension other than .btm Support 6
fishman@panix.com Problem with 27.15 Support 2
M Problem with VSDevCmd.bat in VS 16.7.3 Support 0
R Problem with @INT[ value] in V26 Support 9
M Selecting test "off by one" problem in Take command Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
K_Meinhard Small problem in german IDE 26 Support 3
B Problem with color in nested shells Support 1
Joe Caverly Problem creating and switching to a DESKTOP Support 9
vefatica Another popup problem Support 10
Alpengreis ffind dialog (/W) problem Support 4
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
A Problem with functions @int @decimal and identifying Powershell as a shell. Support 12
B IF command problem in tcexit.btm Support 9
fishman@panix.com Problem at Startup of TCC Support 3
P Problem with SFTP copies Support 7
P Problem with FTP copies Support 10
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
R Problem with %_do_loop in nested do loops Support 2
fishman@panix.com New Problem with later Windows 10 Support 10
Peter Murschall A little problem with LEAVE and COMMENT Support 5
M Handling of %~I problem Support 4
WinLanEm FOR problem Support 18
K Problem With SCRPUT /u Support 3
vefatica What's TCMD's problem with ^e[0m? Support 13
Peter Murschall IDE: RTL with non-English resources-problem is back in Build 28 Support 4
rps Regex problem: \xnn not recognized as a hex character Support 0
rps PRIORITY LOW problem Support 1
old coot Regex problem: \xnn not recognized as a hex character Support 12
vefatica Another problem with build 22. Support 3
Alpengreis [23.x] Download-Problem Support 2
S Problem with " Support 3
C Problem navigating forums Support 11
x13 Problem listing repository files using DIR http(s)://... Support 8
Joe Caverly Problem with TEE in v22 Support 2

Similar threads