--- nfo/perl/libs/shortcuts.pm 2003/05/13 05:36:24 1.9 +++ nfo/perl/libs/shortcuts.pm 2003/06/23 15:59:16 1.10 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: shortcuts.pm,v 1.9 2003/05/13 05:36:24 joko Exp $ +## $Id: shortcuts.pm,v 1.10 2003/06/23 15:59:16 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: shortcuts.pm,v $ +## Revision 1.10 2003/06/23 15:59:16 joko +## major/minor fixes? +## ## Revision 1.9 2003/05/13 05:36:24 joko ## heavy modifications to run_cmd ## + sub get_executable @@ -80,7 +83,9 @@ # => better use absolute path-names only?! my $application = ''; if ($cmd =~ m/\w+\.pl\s*.*/) { - $application = 'perl'; + $application = 'perl '; + } else { + $application = './'; } return $application; } @@ -141,7 +146,7 @@ } else { -e $executable or die("$executable does not exist."); #$basedir = "."; - $basedir .= './'; + #$basedir .= './'; } $cmd = "$basedir$cmd"; @@ -152,6 +157,11 @@ # V2 - via 'system' #system($cmd); + if (not $use_path) { + my $application = get_executable($cmd); + $cmd = "$application$cmd" if $application; + } + # V3 - using IPC::Run (optional) if ($options->{async}) { my $application = get_executable_wrapper($cmd); @@ -171,10 +181,6 @@ #start $cmd or die("IPC::Run could not start '$cmd'."); } else { - if (!$use_path) { - my $application = get_executable($cmd); - $cmd = "$application $cmd" if $application; - } print "run_cmd: system('$cmd').", "\n"; system($cmd); }