[Bio] / FigKernelPackages / SeedAware.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/SeedAware.pm

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

revision 1.3, Mon Aug 23 18:33:11 2010 UTC revision 1.4, Mon Aug 30 17:40:04 2010 UTC
# Line 158  Line 158 
158          );          );
159    
160  #  #
161    # Bah. On Windows, redirecty stuff needs IPC::Run.
162    #
163    
164    our $have_ipc_run;
165    if ($^O =~ /win32/i)
166    {
167        eval {
168            require IPC::Run;
169            $have_ipc_run = 1;
170        };
171    }
172    
173    
174    #
175  #  In case we are running in a SEED, pull in the FIG_Config  #  In case we are running in a SEED, pull in the FIG_Config
176  #  #
177  our $in_SEED;  our $in_SEED;
# Line 340  Line 354 
354      #      #
355      my @cmd_and_args = ref $_[0] eq 'ARRAY' ? @{$_[0]} : @_;      my @cmd_and_args = ref $_[0] eq 'ARRAY' ? @{$_[0]} : @_;
356      my $name = join( ' ', @cmd_and_args );      my $name = join( ' ', @cmd_and_args );
357    
358        if ($have_ipc_run)
359        {
360            my $out;
361            my $ok = IPC::Run::run(\@cmd_and_args, '>', \$out);
362            if (wantarray)
363            {
364                my @out;
365                open(my $fh, "<", \$out);
366                @out = <$fh>;
367                close($fh);
368                return @out;
369            }
370            else
371            {
372                return $out;
373            }
374        }
375    
376      open( PROC_READ, '-|', @cmd_and_args ) || die "Could not execute '$name': $!\n";      open( PROC_READ, '-|', @cmd_and_args ) || die "Could not execute '$name': $!\n";
377    
378      if ( wantarray )      if ( wantarray )

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3