#!/usr/bin/perl -w use strict; use Data::Dumper; use CGI qw/:standard :html3/; use CGI::Carp qw( fatalsToBrowser ); use IPC::Run qw( run ); print header(); my $otype = 'AG'; # Else 'SC' # The reason why I wan't to use PTY is because under backticks # param with 'AG' doesn't work, although 'SC' works # See related links for original problem. my $seq_file = '../input_files/input.txt'; # Backtick output is kept into an array my @output = `src/some_binary.out -f $seq_file -O $otype `; chomp @output; print Dumper \@output; # how can I achieve the similar result with above backtick # (i.e. output the stdout to array) # with IPC::Run here... my @cmd = ( "src/some_binary.out", "-f",$seq_file, "-O", $otype); # I'm stuck here. Don't know how # to construct the command correctly... run \@cmd, 'pty>', \@output ;