interfacing with Perl script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
As I have written a perl script so no need to reinvent the wheel but can
anybody suggest me how to interface?


for ((  i = 1 ;  i <= 19; i++  ))

while [ "$*" != "" ]
  input="$input $indir/$1/sff/*.sff ";

runprog $ref $input

based on the generated file & takes the statistics on it
$numarray="perl $ref.output";


print the statistics into a file
print OUTFP $numarray;


file 1

file 2

then I'll use excel to plot a graph


Re: interfacing with Perl script

ela wrote:
Quoted text here. Click to load it

Well, if I understand you correctly (which may be doubtful, as you
appear to me to have a mix of shell script and Perl above), you want to
run a Perl program from a shell script and have the Perl program's
standard output end up in a file.  This is typically accomplished with
something like:

perl_program_file_name <input_file_name >output_file_name



Bob Walton

Re: interfacing with Perl script

Quoted text here. Click to load it
[snipped confusing description]

I have no idea what you are actually trying to do here, but Perl
provides all the usual inter-process communication methods that you
would expect from any other programming language.
Therefore whatever interface your other process has, chances are very
high that your Perl program can hook into that interface.


Re: interfacing with Perl script

Quoted text here. Click to load it

Ordinarily, you can do this in three steps:
1. read in the file,
2. transform the data, and
3. write out the file.

If you write out the file in a character delimited format, you can
open it in Excel and create any type of chart that you want. However,
from the appearance of your data, it seems that you are already there.

Here is a general template that you can use:

open INFILE, "<my_in_file" or die "$!";
open OUTFINE, ">my_out_file" or die "$!";
while (<INFILE>)
  @line = split /splitchar/;
  printf OUTFILE "%c, %s, %d, %.2f%%\n",
    $line[0], $line[1], $line[2]+14, $line[3]/2*100;
close OUTFILE;
close INFILE;


Site Timeline