JoUthoff has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a perl program to find the longest open reading frames in a mRNA.fa sequence. I can easily do this by calling the file from the script using:
open FILE, "mRNA.fa" or die $!; # Opens mRNA, assoicates FILE
However, my instructor wants the file to be called using command line prompt
perl <programName.pl> <input file>
Now I have tried using the command ARGV to pull the filename from the bash:
my $file = $ARGV[0]; open (my $mRNAfile, "<", $file) or die $!; my @mRNAdata = ( ); # initalizes the variables of array @mRNAdata = <$mRNAfile>;
When I run this, I receive compilation errors for each of the 100 sequences saying:
"Number found where operator expected at - line 1, near "Sequence 1" ( +Do you need to predeclare Sequence?).
Any advice would be greatly appreciated! Thank you!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Shell calling input FASTA file
by AnomalousMonk (Archbishop) on Oct 16, 2014 at 03:44 UTC | |
Re: Shell calling input FASTA file
by biohisham (Priest) on Oct 16, 2014 at 14:01 UTC |