/[cvs]/nfo/perl/libs/shortcuts.pm
ViewVC logotype

Diff of /nfo/perl/libs/shortcuts.pm

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

revision 1.9 by joko, Tue May 13 05:36:24 2003 UTC revision 1.10 by joko, Mon Jun 23 15:59:16 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.10  2003/06/23 15:59:16  joko
6    ##  major/minor fixes?
7    ##
8  ##  Revision 1.9  2003/05/13 05:36:24  joko  ##  Revision 1.9  2003/05/13 05:36:24  joko
9  ##  heavy modifications to run_cmd  ##  heavy modifications to run_cmd
10  ##  + sub get_executable  ##  + sub get_executable
# Line 80  sub get_executable { Line 83  sub get_executable {
83    # => better use absolute path-names only?!    # => better use absolute path-names only?!
84    my $application = '';    my $application = '';
85    if ($cmd =~ m/\w+\.pl\s*.*/) {    if ($cmd =~ m/\w+\.pl\s*.*/) {
86      $application = 'perl';      $application = 'perl ';
87      } else {
88        $application = './';
89    }    }
90    return $application;    return $application;
91  }  }
# Line 141  sub run_cmd { Line 146  sub run_cmd {
146    } else {    } else {
147      -e $executable or die("$executable does not exist.");      -e $executable or die("$executable does not exist.");
148      #$basedir = ".";      #$basedir = ".";
149      $basedir .= './';      #$basedir .= './';
150    }    }
151    $cmd = "$basedir$cmd";    $cmd = "$basedir$cmd";
152    
# Line 152  sub run_cmd { Line 157  sub run_cmd {
157    # V2 - via 'system'    # V2 - via 'system'
158    #system($cmd);    #system($cmd);
159    
160      if (not $use_path) {
161        my $application = get_executable($cmd);
162        $cmd = "$application$cmd" if $application;
163      }
164    
165    # V3 - using IPC::Run (optional)    # V3 - using IPC::Run (optional)
166    if ($options->{async}) {    if ($options->{async}) {
167      my $application = get_executable_wrapper($cmd);      my $application = get_executable_wrapper($cmd);
# Line 171  sub run_cmd { Line 181  sub run_cmd {
181      #start $cmd or die("IPC::Run could not start '$cmd'.");      #start $cmd or die("IPC::Run could not start '$cmd'.");
182            
183    } else {    } else {
     if (!$use_path) {  
       my $application = get_executable($cmd);  
       $cmd = "$application $cmd" if $application;  
     }  
184      print "run_cmd: system('$cmd').", "\n";      print "run_cmd: system('$cmd').", "\n";
185      system($cmd);      system($cmd);
186    }    }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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