I have been a Linux user for a long time, but new to Windows and PowerShell. I just installed Windows7 and Strawberry Perl 5 for the first time. Now I want to do simple command line printing using Windows PowerShell.
It seems that Perl is installed correctly:
PS C: \ Users \ Me> perl -v
This is perl, v5.10.0 built for MSWin32-x86-multi-thread Copyright
1987-2007, Larry Wall
...
And the command line works:
PS C: \ Users \ Me> perl -e 'die'
Died at -e line 1.
PS C: \ Users \ Me> echo 'print "Hello, World \ n"' | perl
Hello world
But when I try to do this on my own, it prints a warning with the file manager:
PS C: \ Users \ Me> perl -e 'print "Hello, World \ n"'
No comma allowed after filehandle at -e line 1.
So it looks like it removes double quotes.
PS C: \ Users \ Me> perl -e 'print \ "Hello, World \ n \"'
Hello world
It works, but its ugly! Try again:
PS C: \ Users \ Me> perl -e 'print qq {Hello, World \ n}'
Hello world
I like it more, but I'm confused.
Why does PowerShell avoid double quotes in single quotes? Any PowerShell users?
perl powershell
Coffeemonster
source share