Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
non installed Perl in Windows ?
nipper
Not TS related.... Looking to cut a CD which would execute a CGI. I prefer not to have an install & would
like to write it in Perl. My question is if I include Perl on the CD, can I just put a bat file together to set any
ENV variables I need & Perl will work ?
Tips/Pointers/RTFMs appreciated
Andy
Find more posts tagged with
Comments
Migrateduser
Rather than using the perl interpretter, you might want to consider compiling the perl. You can turn your perl code into an executable. See this
http://www.indigostar.com/perl2exe.htm
.
If that isn't going to work for you, then my guess (have not tested) would be that putting the perl interpretter on a CD should allow you to execute perl code from the CD.
- Jason
Migrateduser
Do you write .bat files that are perl progrms? This is my preferred approach when writing perl that has to run in a Windows CMD/COMMAND shell. It req's an ~10-line header to your perl:
@rem
= '--*-Perl-*--
@echo
off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "./%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S "./%0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
goto endofperl
@rem
';
... and a two line footer:
__END__
:endofperl
IIRC you don't have to settle for args 1- 9 and can use a %* construct. But I lifted the above from something I know works. To avoid double maintenance, I just write the perl program and have 'make' apply the header and footer to build the .bat.