summaryrefslogtreecommitdiff
path: root/bin/PerlACE/Process.pm
blob: 52df7aa6c8f04dfe15cdce01044c863cc641fee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# $Id$

package PerlACE::Process;

use strict;
use English;

$PerlACE::Process::ExeSubDir = './';

### Check for -ExeSubDir commands, store the last one
my @new_argv = ();

for(my $i = 0; $i <= $#ARGV; ++$i) {
    if ($ARGV[$i] eq '-ExeSubDir') {  
        if (defined $ARGV[$i + 1]) {
            $PerlACE::Process::ExeSubDir = $ARGV[++$i].'/';
        }
        else {
            print STDERR "You must pass a directory with ExeSubDir\n";
            exit(1);
        }
    }
    else {
        push @new_argv, $ARGV[$i];
    }
}
@ARGV = @new_argv;

if ($OSNAME eq "MSWin32") {
	require PerlACE::Process_Win32;
}
else {
	require PerlACE::Process_Unix;
}

1;