in reply to Re^4: Proper and acceptable use of backticks in a modern Perl script
in thread Proper and acceptable use of backticks in a modern Perl script

The script is not using this $ENV{PATH} variable for anything...

Are you sure it's not using it to run sh? Remember, backticks aren't "execute this program", they're "pass this string to sh"; that's why you can just cram all the args together in one string, expect $PATH (the $PATH the shell sees, not perl's var) to affect things, expand shell vars and wildcards, etc.

  • Comment on Re^5: Proper and acceptable use of backticks in a modern Perl script

Replies are listed 'Best First'.
Re^6: Proper and acceptable use of backticks in a modern Perl script
by Polyglot (Chaplain) on Sep 21, 2023 at 04:23 UTC
    You certainly seem unsure. Perhaps you can find out and enlighten us. I suppose you would say that setting $ENV{PATH} will affect everything that Perl does--where it finds its modules, where it runs its "system" command as well, etc. I'm not sure how gullible I am assumed to be to think Perl is so unstable as this would obviously make it. But it does appear that some rather odd things with Perl erasing the $ENV{PATH} crept in post version 5.26. As I said earlier, I've been fortunate (until now) to be on older versions previous to this.

    Blessings,

    ~Polyglot~