--- nfo/perl/libs/shortcuts.pm 2003/03/28 06:58:06 1.6 +++ nfo/perl/libs/shortcuts.pm 2003/03/29 07:24:10 1.7 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: shortcuts.pm,v 1.6 2003/03/28 06:58:06 joko Exp $ +## $Id: shortcuts.pm,v 1.7 2003/03/29 07:24:10 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: shortcuts.pm,v $ +## Revision 1.7 2003/03/29 07:24:10 joko +## enhanced 'run_cmd': now tries to execute program with appropriate application (e.g. 'cmd.exe' or 'perl') +## ## Revision 1.6 2003/03/28 06:58:06 joko ## new: 'run_cmd' now asynchronous! (via IPC::Run...) ## @@ -101,7 +104,17 @@ # FIXME: detect type of program and run with proper application/interpreter # using IPC::Run we have to dispatch this on our own! *no* os-interaction or interpolation here! # => better use absolute path-names only?! - $cmd = "perl $cmd"; + my $application = ''; + if (RUNNING_IN_HELL()) { + $application = 'cmd.exe /C'; + } + + if ($cmd =~ m/\w+\.pl\s*.*/) { + $application = 'perl'; + } + + $cmd = "$application $cmd" if $application; + print "IPC::Run: $cmd", "\n"; #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";