/[cvs]/nfo/perl/libs/Data/Rap/Engine.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Rap/Engine.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by joko, Thu Mar 27 15:31:05 2003 UTC revision 1.7 by joko, Fri Mar 28 07:02:56 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ----------------------------------------------------------------------  ## ----------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.7  2003/03/28 07:02:56  joko
6    ##  modified structure around '$wrapper_program'
7    ##
8  ##  Revision 1.6  2003/03/27 15:31:05  joko  ##  Revision 1.6  2003/03/27 15:31:05  joko
9  ##  fixes to modules regarding new namespace(s) below Data::Mungle::*  ##  fixes to modules regarding new namespace(s) below Data::Mungle::*
10  ##  ##
# Line 303  sub run_executable { Line 306  sub run_executable {
306      delete $opts->{executable};      delete $opts->{executable};
307    
308      # determine execution method      # determine execution method
     my $method = 'run_cmd';  
309      my $wrapper_program = '';      my $wrapper_program = '';
310            
311      # check if program is a namespace-string (contains '::') - use 'do' in this case!      # check if program is a namespace-string (contains '::') - use 'do' in this case!
312      if ($program =~ /::/) {      if ($program =~ /::/) {
313      #if ($program =~ s/::/\\/g) {        #$wrapper_program = 'rap.pl';
314        #$program = '.\\' . $program;        $wrapper_program = $0;
       #$method = 'require';  
       #do "$program";  
       #return;  
       #$method = 'rap.';  
         
       $wrapper_program = 'rap.pl';  
         
315      }      }
316    
317      # prepare arguments      # prepare arguments
# Line 340  sub run_executable { Line 335  sub run_executable {
335      }      }
336    
337      # build {program} & {arguments}        # build {program} & {arguments}  
338      my $cmd = join(' ', $wrapper_program, $program) . ' ' . join(' ', @buf);      my $cmd = ($wrapper_program ? $wrapper_program . ' ' : '') . $program . ' ' . join(' ', @buf);
339            
340      # trace      # trace
341        #print "command: $cmd", "\n";        #print "command: $cmd", "\n";
# Line 354  sub run_executable { Line 349  sub run_executable {
349                
350        #print Dumper(%ENV);        #print Dumper(%ENV);
351                
352        print "command: '$cmd'", "\n";        #print "command: '$cmd'", "\n";
353    
354        # V1 - basic        # V1 - basic
355        #run_cmd($cmd);        #run_cmd($cmd);
356    
357        # V1.b - enhanced: variable local method        # V1.b - enhanced: variable local method
358        my $evalstr = "$method('$cmd');";        my $evalstr = "run_cmd('$cmd', 'Some task...', { async => 1 });";
359        eval($evalstr);        eval($evalstr);
360        #my $res = do "$cmd";        #my $res = do "$cmd";
361        #print $res, "\n" if $res;        #print $res, "\n" if $res;
# Line 370  sub run_executable { Line 365  sub run_executable {
365    
366        # V2: via IPC::Run        # V2: via IPC::Run
367        # ....  (TODO)        # ....  (TODO)
368              
369            
370    }    }
371        

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed