C:\Windows\system32>perl -e 'print "Hello World\n"'
Can't find string terminator "'" anywhere before EOF at -e line 1.
Asked
Active
Viewed 60 times
-1

melpomene
- 84,125
- 8
- 85
- 148
1 Answers
4
On MSWin, single quotes behave differently to *nix shells. You need double quotes instead, and for the inside, use the qq
operator.
perl -e "print qq(Hello World\n)"

choroba
- 231,213
- 25
- 204
- 289
-
Thank you it worked. Why the qq? – Sunny Shinde Sep 13 '19 at 20:16
-
To avoid the need to escape the nested double quotes. – choroba Sep 13 '19 at 22:45