Shouldn't '#!/usr/bin/perl -w' be put on the top of the script?

On Tue, Aug 28, 2012 at 10:28 PM, Jim Gibson <jimsgib...@gmail.com> wrote:
>
> 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/


Reply via email to