Hello Perl Monks!
I have a two part question:
I'm writing a program where it has to scan for all files of a particular extension and continue working with them. For example, all *.pep files are to be processed in some way. Since the file is pretty large, I'd like the piped input to be read into an array and not a scalar.
Initially I was using the filename from user input, like so :
print "Enter the name of the files containing all the proteomic inform
my $filename = <STDIN>;
unless( $filename =~ /\.pep?$/)
#Checking if the file extension is .pep
die "File is not .pep file. Exiting. \n";
open (DATA, $filename) or die "Cannot open $filename!\n";
my @arraydata = <DATA>;
#all the information in the pep file is input into an array
How do I convert this to using pipes?
Is it simply:
open(DATA, '| >*.pep');
I want to use the output from this program as input for another program. Can this be done by just modifying the data input 'open' line in the other program?
This is my first program using pipes so I'd appreciate your help. Thanks :)