How do i make a perl script more portable?



  • When installing perl the location of the binary could be /usr/bin or /usr/local/bin, to make the perl script more portable.

    The first line in the script can be written like this:

    #!/usr/bin/env perl
    

    This determines where perl is located.

    Note: This find the first perl binary in your environment PATH, if you need to be specific use the full path to the perl binary in your script.


Log in to reply
 

© Lightnetics 2024