------=_Part_15508_11273949.1206491424489
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Consider the following program- HydrophobicityProfiler.pl
Here is a sample run of the program:
perl HydrophobicityProfiler.pl
Enter the name of the sequence file (try protein.txt) and then press
Enter:
.../data/protein.txt
Enter the desired window size as an odd number and then press Enter:
5
Which method would you like to use (Kyte-Doolittle, Eisenberg, Hopp-Woods,
Janin, or Rose):
Eisenberg
The program sequentially asks the user for 3 parameters: name of sequence
file; desired window size and method
I tried to write a perl program that would use a filehandle to run
HydrophobicityProfiler.pl.
Here it is:
#! /usr/bin/perl
use strict;
use warnings;
open(HP, "|perl ./HydrophobicityProfiler.pl \n");
HP->autoflush(1);
print HP "../data/protiein.txt \n";
print HP "5 \n";
print HP "Kyte-Doolittle \n";
close HP;
Unfortunately this gives me a list of errors:
perl handle_test.pl
Can't locate object method "autoflush" via package "IO::Handle" at
handle_test.pl line 7.
anjan-purkayasthas-powerbook-g4-17:~/perl_directory/programs anjan$ Enter
the name of the sequence file (try protein.txt) and then pr
ess Enter:
Use of uninitialized value in scalar chomp at ./HydrophobicityProfiler.pl
line 20.
Enter the desired window size as an odd number and then press Enter:
Use of uninitialized value in scalar chomp at ./HydrophobicityProfiler.pl
line 23.
Which method would you like to use (Kyte-Doolittle, Eisenberg, Hopp-Woods,
Janin, or Rose):
Use of uninitialized value in scalar chomp at ./HydrophobicityProfiler.pl
line 26.
Use of uninitialized value in open at ./HydrophobicityProfiler.pl line 28.
Cannot open the file: No such file or directory
So my question is. Is it possible to write a program to run an interactive
program using file handles?
TIA,
Anjan
--
ANJAN PURKAYASTHA, PhD.
Senior Computational Biologist
==========================
1101 King Street, Suite 310,
Alexandria, VA 22314.
703.518.8040 (office)
703.740.6939 (mobile)
email:
anjan@[EMAIL PROTECTED]


|