Dear All I got it work by moving #!/usr/bin/perl to the top. Thank you all! There is an error in my script. length(@startSite)-1 cannot give me the last element of the array. I changed it to $#startSite, and got the results what i want.
Thank you again! Best regards Li ________________________________________ From: Jim Gibson [jimsgib...@gmail.com] Sent: Wednesday, August 29, 2012 12:28 AM To: perl list Subject: Re: how to handle two input files On Aug 28, 2012, at 9:01 PM, Wang, Li wrote: > Dear All > [problem description snipped] > My script is as follows. And usage is: ./myscript.pl FstFile.txt > annotationFile.txt > > # USAGE: > # unix command line: > # ./searchAndPrint.pl FstFile.name annotationFile.name > > #!/usr/bin/perl -w > use strict; > use warnings; > > [rest of program snipped] > But I got errors as follows: > ./searchAndPrint.pl: line 6: use: command not found > ./searchAndPrint.pl: line 7: use: command not found > ./searchAndPrint.pl: line 9: my: command not found It looks like your program is being executed by the shell, not the Perl interpreter. What do you get from these commands: which perl perl -v Try to execute your program this way: perl searchAndPrint.pl FstFile.name annotationFile.name and let us know what you get. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/