You could try a few things:

  • Use system to run Perl -v and use that to figure out where Perl's libraries are. You could then walk up the library locations to test for a bin directory. For instance ActiveState Perl has a pretty standard installation, I'm sure other Perls do as well;
  • Use a standardized installation for Perl on all recipient machines - that way you known where it is always going to be. Make sure perl is part of your PATH variables. For instance if you run set through a system or cmd call, you can grep for PATH and then grep for the instance of your Perl installation. That's something you may have to organize with your IT department;
  • Use a packaging program to bundle up Perl with the associated program and modules you need to run your stuff. I use ActiveState's PDK PerlApp for this. Its pretty robust and I know I can create something that other IT groups can install on a large number of computers.

    Of course if you can run the app through the web you can avoid installation issues...

    Hope that helps.

    MadraghRua
    yet another biologist hacking perl....


    In reply to Re: Avoiding Hardcoded path of Perl.exe in coding by MadraghRua
    in thread Avoiding Hardcoded path of Perl.exe in coding by toastbread

    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.