in reply to Executing a program from within a Perl Module in a non-standard path
What would I do in this instance?
do what every operating system does, create an environment variable, like $PATH, and have it be a "list" of directories to search for binary executables. Since one exists for this purpose already, you could use it, but you don't have to
use lib ...;
use PathStuffer;
use File::Which;
my $frobnitz = which('checkout.pl');
system $frobnitz, ...
package PathStuffer;
use Env '@PATH';
use File::Find::Rule;
push @PATH, find( -file => name => qr{\.pl$} => in => $startdir);
See also Toolkit, String::ShellQuote/Win32::ShellQuote and/or IPC::System::Simple or IPC::Run/IPC::Run3 .. String::ShellQuote/Win32::ShellQuote and/or IPC::System::Simple or IPC::Run/IPC::Run3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Executing a program from within a Perl Module in a non-standard path ($PATH/%PATH%)
by GoldElite (Beadle) on Mar 20, 2013 at 11:45 UTC |