2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.7 2003/03/29 07:24:10 joko |
6 |
|
## enhanced 'run_cmd': now tries to execute program with appropriate application (e.g. 'cmd.exe' or 'perl') |
7 |
|
## |
8 |
## Revision 1.6 2003/03/28 06:58:06 joko |
## Revision 1.6 2003/03/28 06:58:06 joko |
9 |
## new: 'run_cmd' now asynchronous! (via IPC::Run...) |
## new: 'run_cmd' now asynchronous! (via IPC::Run...) |
10 |
## |
## |
104 |
# FIXME: detect type of program and run with proper application/interpreter |
# FIXME: detect type of program and run with proper application/interpreter |
105 |
# using IPC::Run we have to dispatch this on our own! *no* os-interaction or interpolation here! |
# using IPC::Run we have to dispatch this on our own! *no* os-interaction or interpolation here! |
106 |
# => better use absolute path-names only?! |
# => better use absolute path-names only?! |
107 |
$cmd = "perl $cmd"; |
my $application = ''; |
108 |
|
if (RUNNING_IN_HELL()) { |
109 |
|
$application = 'cmd.exe /C'; |
110 |
|
} |
111 |
|
|
112 |
|
if ($cmd =~ m/\w+\.pl\s*.*/) { |
113 |
|
$application = 'perl'; |
114 |
|
} |
115 |
|
|
116 |
|
$cmd = "$application $cmd" if $application; |
117 |
|
|
118 |
print "IPC::Run: $cmd", "\n"; |
print "IPC::Run: $cmd", "\n"; |
119 |
#run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?"; |
#run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?"; |
120 |
|
|