C:\chas_sandbox>copy con "My Echo.pl"
print "hello, world\n";
^Z
1 file(s) copied.
C:\chas_sandbox>copy con "My Echo (v1).pl"
print "hello, world\n";
^Z
1 file(s) copied.
C:\chas_sandbox>"My Echo (v1).pl"
hello, world
C:\chas_sandbox>"My Echo.pl"
hello, world
C:\chas_sandbox>perl -e "print STDERR `"My Echo.pl"`;"
Can't find string terminator "`" anywhere before EOF at -e line 1.
C:\chas_sandbox>perl -e "print STDERR `"""My Echo.pl"""`;"
hello, world
C:\chas_sandbox>perl -e "print STDERR `"My Echo (v1).pl"`;"
Can't find string terminator "`" anywhere before EOF at -e line 1.
C:\chas_sandbox>perl -e "print STDERR `"""My Echo (v1).pl"""`;"
'My' is not recognized as an internal or external command,
operable program or batch file.
It's obviously getting to the cmd shell, since the not recognized as an internal or external command is from cmd.
per Sandy's message, below, it's definitely the ()'s that are messing you up. And it's cmd that doesn't like them, not Perl.
I know you're still asking "why?" but here's another tack for a work-around:
C:\chas_sandbox>dir /x "My Echo (v1).pl"
Volume in drive C has no label.
Volume Serial Number is D425-A27D
Directory of C:\chas_sandbox
09/07/2007 04:22 PM 25 MYECHO~2.PL My Echo (v1).pl
1 File(s) 25 bytes
0 Dir(s) 28,821,581,824 bytes free
C:\chas_sandbox>perl -e "print STDERR `MYECHO~2.PL`;"
hello, world
C:\chas_sandbox>
I've used dir /x to get the short name and called the script using the shortname between the backticks.
|