I need to run the following command from inside a Perl script in Windows. The code can't be simpler than this:
#! C:\Perl\bin\perl
perl -e "print qq(Hello)";
I save this file as test.pl
. I open a command prompt in Windows and run the following from the c:\Per\bin
directory. When I run it as perl test.pl
, I get the following result:
C:\Perl\bin>perl test.pl
syntax error at test.pl line 3, near ""perl -e "print"
Execution of test.pl aborted due to compilation errors.
How can I fix this? If I just run perl -e
from the command prompt (i.e. without being inside the file) it works great.