Kathryn E. Bushley wrote: > Hello, Hello,
> Maybe not a perl question but I'm trying to run my perl program below and > am getting the following error which I'm fairly certain is from the linux > system: > >>(BC1G_02948.1) AMP 1/1 144 522 > sh: -c: line 0: syntax error near unexpected token `(' > sh: -c: line 0: `getseq.pl 56 374 (BC1G_03519.1) Botrytis_annotations' perldoc -q "How do I tell the difference between errors from the shell and perl" Also search for "syntax error" in perldiag. > The first line of this message is what line 29 of the main program below > is supposed to print out but then it is also supposed to print dna > sequence data but instead prints the error. If anyone has any > suggestions, please help. > > > The main program is: > > #!/usr/bin/perl -w use warnings; use strict; > $annotation_filename = $ARGV[0]; > my $protein_filename = "$ARGV[1]"; $ARGV[1] is already a string, why are you putting quotes around it? > #input parameter; > my $domain_param = "$ARGV[2]"; Again, why the quotes? perldoc -q quoting > print "domain_param->".$domain_param."\n"; Why concatenation instead of interpolation here? > #open annotation file and assign file handle > open(ANN,$annotation_filename)|| die "can't open annotation file: $!\n"; > > #initialize array and store data in the array > my(@ANN); > while (<ANN>){ > # split the line on spaces and put fields into array @ANN > @ANN = split(/\s+/);# print join(",", @ANN), "\n"; > #get rid of carriage returns > chomp; Why do you think that there is a carriage return to get rid of and why do you think that chomp() will get rid of it? > my $proteinID = $ANN[0]; > my $domain = $ANN[1]; > my $start = $ANN[2]; > my $stop = $ANN[3]; What is the point of using the @ANN array? my ( $proteinID, $domain, $start, $stop ) = split; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>