Make your C:/Perl (or whatever) directory shared, read-only with a share name of "Perl". Run your script through pl2bat (which is included with your copy of Perl). Edit the resulting *.bat file to replace the call to "perl" with a call to "//bigtiny/Perl/bin/perl" (you can use backslashes instead of forward slashes if you prefer).
On a typical corporate Windows-based network, this will work, though a bit slowly. Get your coworkers hooked and then get them to install Perl to make things run faster.
If you don't plan to run this on Win9x, then you can even have the *.bat file silently detect whether a local copy of Perl can be used. On Win9x, such a test is harder and may require spurious errors be displayed in some cases.
Here is some untested sample code (I don't have Win9x handy):
- tye (but my friends call me "Tye")if "%OS%" == "Windows_NT" goto WinNT perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel 1 //bigtiny/perl/bin/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 //bigtiny/perl/bin/perl -x -S "%0" %1 %2 %3 %4 + %5 %6 %7 %8 %9 if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl
In reply to (tye)Re: How can I share PERL scripts with people who don't have PERL installed?
by tye
in thread How can I share PERL scripts with people who don't have PERL installed?
by bigtiny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |