Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I think, the solution to your problem might be getting rid of one or more instances of perl. Just have one. Why have more?

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:

@ECHO OFF
C:\BIN\PERL\TINYPERL -I C:\BIN\PERL\LIB "%1" %2 %3
ECHO.
PAUSE

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.)

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.

So, the PERL.REG file looks like this:

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\""

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.

RUNCGI.BAT:

@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

In reply to Re: [implementation specific to windows] writing a proper batch file for terminal start-up by harangzsolt33
in thread [implementation specific to windows] writing a proper batch file for terminal start-up by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (4)
    As of 2019-12-11 23:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?