Dear Masters,

I usually runs backtick to output it's value into an array. Since I have a problem with TTY, now I would like to do the very same task under IPC::Run's 'PTY' command.

But I'm not sure how to do it? Can anybody suggest how to go about it?
#!/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<', \$in, '>pty>', \@output ;


---
neversaint and everlastingly indebted.......

In reply to Backticks equivalent of outputting the STDOUT to an array to IPC::Run's PTY by neversaint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.