Hi, I am am a longtime Linux user but am new to Windows and PowerShell. I just installed Windows7 and Strawberry Perl 5 for the first time. I now want to do a simple command-line print with Windows PowerShell.
It looks like Perl 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 command-line stuff 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 it all by itself it prints a filehandler warning:
PS C:\Users\Me> perl -e 'print "Hello, World\n"' No comma allowed after filehandle at -e line 1.
So it looks like its removing the double quotes.
PS C:\Users\Me> perl -e 'print \"Hello, World\n\"' Hello, World
That works but its Ugly! Lets try again:
PS C:\Users\Me> perl -e 'print qq{Hello, World\n}' Hello, World
Thats more like it, but I'm confused.
Why is PowerShell is escaping the double quotes within the single quotes? Any PowerShell users out there?