--- nfo/perl/libs/Data/Rap/Engine.pm 2003/03/27 15:31:05 1.6 +++ nfo/perl/libs/Data/Rap/Engine.pm 2003/03/28 07:02:56 1.7 @@ -1,7 +1,10 @@ ## ---------------------------------------------------------------------- -## $Id: Engine.pm,v 1.6 2003/03/27 15:31:05 joko Exp $ +## $Id: Engine.pm,v 1.7 2003/03/28 07:02:56 joko Exp $ ## ---------------------------------------------------------------------- ## $Log: Engine.pm,v $ +## Revision 1.7 2003/03/28 07:02:56 joko +## modified structure around '$wrapper_program' +## ## Revision 1.6 2003/03/27 15:31:05 joko ## fixes to modules regarding new namespace(s) below Data::Mungle::* ## @@ -303,20 +306,12 @@ delete $opts->{executable}; # determine execution method - my $method = 'run_cmd'; my $wrapper_program = ''; # check if program is a namespace-string (contains '::') - use 'do' in this case! if ($program =~ /::/) { - #if ($program =~ s/::/\\/g) { - #$program = '.\\' . $program; - #$method = 'require'; - #do "$program"; - #return; - #$method = 'rap.'; - - $wrapper_program = 'rap.pl'; - + #$wrapper_program = 'rap.pl'; + $wrapper_program = $0; } # prepare arguments @@ -340,7 +335,7 @@ } # build {program} & {arguments} - my $cmd = join(' ', $wrapper_program, $program) . ' ' . join(' ', @buf); + my $cmd = ($wrapper_program ? $wrapper_program . ' ' : '') . $program . ' ' . join(' ', @buf); # trace #print "command: $cmd", "\n"; @@ -354,13 +349,13 @@ #print Dumper(%ENV); - print "command: '$cmd'", "\n"; + #print "command: '$cmd'", "\n"; # V1 - basic #run_cmd($cmd); # V1.b - enhanced: variable local method - my $evalstr = "$method('$cmd');"; + my $evalstr = "run_cmd('$cmd', 'Some task...', { async => 1 });"; eval($evalstr); #my $res = do "$cmd"; #print $res, "\n" if $res; @@ -370,7 +365,7 @@ # V2: via IPC::Run # .... (TODO) - + }