diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2004-05-18 14:39:41 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2004-05-18 14:39:41 +0000 |
commit | f562e697f50add73fd6157b169bc9bac02aff1a1 (patch) | |
tree | 4c6083c657aa16357449be9d958ceba684ee1ef4 /mwc.pl | |
parent | ab62dcd73f740c95da4d6480a51b4016f47414d4 (diff) | |
download | MPC-f562e697f50add73fd6157b169bc9bac02aff1a1.tar.gz |
ChangeLogTag: Tue May 18 09:37:29 2004 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'mwc.pl')
-rwxr-xr-x | mwc.pl | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -14,6 +14,7 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' use strict; use Cwd; +use Config; use File::Basename; my($basePath) = getExecutePath($0); @@ -25,13 +26,18 @@ require MWC; # Subroutine Section # ************************************************************ +sub getBasePath { + return $basePath; +} + + sub which { - my($prog) = shift; - my($exec) = $prog; - my($part) = ''; - my($envSep) = ($^O eq 'MSWin32' ? ';' : ':'); + my($prog) = shift; + my($exec) = $prog; if (defined $ENV{'PATH'}) { + my($part) = ''; + my($envSep) = $Config{'path_sep'}; foreach $part (split(/$envSep/, $ENV{'PATH'})) { $part .= "/$prog"; if ( -x $part ) { |