Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

(jptxs)Re: win32 perl script when you don't know where perl is - my solution

by jptxs (Curate)
on Jan 22, 2002 at 02:45 UTC ( #140512=note: print w/replies, xml ) Need Help??

in reply to win32 perl script when you don't know where perl is

with a little help from my friends here and abroad:
@echo off rem Have echo follow the ECHO environment variable. Used for debugging +. if not {%ECHO%} == {} echo %ECHO% rem Make sure this is Windows NT. if not {%OS%} == {Windows_NT} goto :NOT_NT rem Set path for Windows commands. set WINEXE="%windir%\system32" rem Save the current environment and directory. setlocal pushd . if defined PERL goto :RUNPERL if not defined HOME ( for /f "tokens=*" %%i in ('cd') do set home=%%i ) if not defined HOME ( set HOME=%home:\tools\script=% ) if not exist "%HOME%\World" ( echo ERROR: Cannot determine HOME ^(please set it manually^) goto :DONE ) set OLDHOME=%HOME% if exist "%OLDHOME%\bin\Windows2000" set OLDARCH=Windows2000 if exist "%OLDHOME%\bin\WinNT4.0" set OLDARCH=WinNT4.0 set ARCH=%OLDARCH% set BIN=%HOME%\bin\%ARCH% if not exist "%BIN%" ( echo ERROR: BIN not found ^(BIN^) goto :DONE ) set LD_LIBRARY_PATH=%HOME%\lib\%ARCH% set PLAT=%ARCH% set PERL=%HOME%\tools\bin\%PLAT%\perl if not exist "%PERL%.exe" ( echo ERROR: perl not found ^(%PERL%.exe^) goto :DONE ) for /f "tokens=*" %%i in ('hostname') do set HOSTNAME=%%i :RUNPERL rem echo running PERL rem CMD /c %PERL%.exe %0 rem goto :DONE if exist "%HOME%\tools\script\" ( call "%PERL%.exe" "%HOME%\tools\script\" %2 ) else ( echo ERROR: %HOME%\tools\script\ doesn't exist ) goto :DONE :DONE popd & endlocal goto :EOF :NOT_NT rem ////////////////////////////////////////////////////////////////// +/////// rem This is not Windows NT. rem This procedure must fall through to the end of the file, for compa +tibility. echo This script requires Windows NT. rem ////////////////////////////////////////////////////////////////// +///////

We speak the way we breathe. --Fugazi

  • Comment on (jptxs)Re: win32 perl script when you don't know where perl is - my solution
  • Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://140512]
[1nickt]: ugh, buying a computer is hard for an old person
[stevieb]: How do you mean?
[1nickt]: They assume that I want things I don;t and don;t provide things I do want. Looking for a 17" laptop with 4k (even 3K display) and full numeric-pad keyboard.
[1nickt]: They assume that if I want a 17" monitor I could not possibly want 4k screen
[1nickt]: They assume I do not need a DVD drive

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-03-26 18:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.