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

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

        - tye (but my friends call me "Tye")

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

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, details, 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, summary, 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.