/[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.6 by joko, Fri Mar 28 06:58:06 2003 UTC revision 1.7 by joko, Sat Mar 29 07:24:10 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.7  2003/03/29 07:24:10  joko
6    ##  enhanced 'run_cmd': now tries to execute program with appropriate application (e.g. 'cmd.exe' or 'perl')
7    ##
8  ##  Revision 1.6  2003/03/28 06:58:06  joko  ##  Revision 1.6  2003/03/28 06:58:06  joko
9  ##  new: 'run_cmd' now asynchronous! (via IPC::Run...)  ##  new: 'run_cmd' now asynchronous! (via IPC::Run...)
10  ##  ##
# Line 101  sub run_cmd { Line 104  sub run_cmd {
104      # FIXME: detect type of program and run with proper application/interpreter      # FIXME: detect type of program and run with proper application/interpreter
105      # using IPC::Run we have to dispatch this on our own! *no* os-interaction or interpolation here!      # using IPC::Run we have to dispatch this on our own! *no* os-interaction or interpolation here!
106      # => better use absolute path-names only?!      # => better use absolute path-names only?!
107      $cmd = "perl $cmd";      my $application = '';
108        if (RUNNING_IN_HELL()) {
109          $application = 'cmd.exe /C';
110        }
111        
112        if ($cmd =~ m/\w+\.pl\s*.*/) {
113          $application = 'perl';
114        }
115        
116        $cmd = "$application $cmd" if $application;
117        
118      print "IPC::Run: $cmd", "\n";      print "IPC::Run: $cmd", "\n";
119      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";
120            

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