note
harangzsolt33
<B>I think, the solution to your problem might be getting rid of one or more instances of perl. Just have one. Why have more?
<P>I'm currently running 32-bit Windows XP Pro with TinyPerl 5.8.0 here. This is the only perl on my computer located at C:\BIN\PERL. In that same folder I created a file called RUN.BAT, which contains the following:
<P>
<BLOCKQUOTE><TT>
@ECHO OFF
<BR>C:\BIN\PERL\TINYPERL -I C:\BIN\PERL\LIB "%1" %2 %3
<BR>ECHO.
<BR>PAUSE
</TT></BLOCKQUOTE>
<P>When I double-click on a PL file, I associated it with RUN.BAT, so when I click to open, it runs and the terminal window stays open until I press enter. It's a pretty simple solution. (I don't have any environmental variables set for perl. I just pass the necessary values in the command line.)</B>
<P>I have also downloaded an icon that looks like a blue script thingy. And I created a REG file, which ties the PL and PM and CGI extensions to that icon file. So, all PL files on my computer appear with that little blue icon. I can very easily distinguish perl scripts from other files.
<P>So, the PERL.REG file looks like this:
<CODE>
REGEDIT4
[HKEY_CLASSES_ROOT\pm_auto_file]
[HKEY_CLASSES_ROOT\pm_auto_file]
@=""
[HKEY_CLASSES_ROOT\pm_auto_file\DefaultIcon]
[HKEY_CLASSES_ROOT\pm_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pm_auto_file]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pm_auto_file\DefaultIcon]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pm_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_CLASSES_ROOT\cgi_auto_file]
[HKEY_CLASSES_ROOT\cgi_auto_file]
@=""
[HKEY_CLASSES_ROOT\cgi_auto_file\DefaultIcon]
[HKEY_CLASSES_ROOT\cgi_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_CLASSES_ROOT\cgi_auto_file\shell]
[HKEY_CLASSES_ROOT\cgi_auto_file\shell\edit]
[HKEY_CLASSES_ROOT\cgi_auto_file\shell\edit\command]
@="\"C:\\Windows\\system32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\cgi_auto_file\shell\open]
[HKEY_CLASSES_ROOT\cgi_auto_file\shell\open\command]
@="\"C:\\BIN\\PERL\\runcgi.bat\" \"%1\""
[HKEY_CLASSES_ROOT\pl_auto_file]
[HKEY_CLASSES_ROOT\pl_auto_file]
@=""
[HKEY_CLASSES_ROOT\pl_auto_file\DefaultIcon]
[HKEY_CLASSES_ROOT\pl_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_CLASSES_ROOT\pl_auto_file\shell]
[HKEY_CLASSES_ROOT\pl_auto_file\shell\edit]
[HKEY_CLASSES_ROOT\pl_auto_file\shell\edit\command]
@="\"C:\\Windows\\system32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\pl_auto_file\shell\open]
[HKEY_CLASSES_ROOT\pl_auto_file\shell\open\command]
@="\"C:\\BIN\\PERL\\run.bat\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\DefaultIcon]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\edit]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\edit\command]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\edit\command]
@="\"C:\\Windows\\system32\\notepad.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\open\command]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cgi_auto_file\shell\open\command]
@="\"C:\\BIN\\PERL\\runcgi.bat\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\DefaultIcon]
@="C:\\BIN\\PERL\\PERL.ICO"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\shell\edit]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\shell\edit\command]
@="\"C:\\Windows\\system32\\notepad.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pl_auto_file\shell\open\command]
@="\"C:\\BIN\\PERL\\run.bat\" \"%1\""
</CODE>
<P>When I click on CGI files, an entirely different script runs which saves the perl output as a html file and then opens it with Internet Explorer. So, I get to see what the output might look like if the script were to run on a server.
<P>RUNCGI.BAT:
<CODE>
@ECHO OFF
C:\BIN\PERL\TINYPERL -I C:\BIN\PERL\LIB "%1" > C:\BIN\PERL\OUTPUT.HTM
C:
CD "C:\Program Files\Internet Explorer"
START IEXPLORE.EXE C:\BIN\PERL\OUTPUT.HTM
EXIT
</CODE>
11107515
11107515