in reply to Re^4: standard library to return system paths
in thread standard library to return system paths
Example:
You just have to ensure that your Perl applications are installed using the fixed directory structure matching your code expectations.# untested! use File::Spec; BEGIN { my $script = File::Spec->rel2abs($0); my ($drive, $dir) = File::Spec->splitpath($script); my $base = File::Spec->catpath($drive, $dir); if ($^O eq 'MSWin32') { push @INC, "$base\\lib"; } else { push @INC, "$base/../lib"; } }
Update: Also, on Windows you may like to store the path to your application on the registry when it is installed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: standard library to return system paths
by igoryonya (Pilgrim) on Jun 07, 2016 at 09:06 UTC |