• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Perl -e question

Hi, I tried the following in UNIX. It works. Tried the same thing in Win NT, it doesn't. May I know the problem? THANKS.

perl -e 'print 1+1;'
Can't find string terminator "'" anywhere before EOF at -e line 1.
0
jaq
Asked:
jaq
  • 4
  • 3
1 Solution
 
martinagCommented:
perl -e "print 1+1;"
?

Martin
0
 
b2piCommented:
Use double quotes.  NT does not treat single quotes as quotes. There is some discussion of this in the README.win32 file that comes with the standard distribution.

0
 
martinagCommented:
This is the kind of things that makes you wonder what you're doing around here...

Martin
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
b2piCommented:
What do you mean?
0
 
martinagCommented:
I suggested doubles instead of singles in my comment. But after all, your answer gives more details about the problem so I won't start a fight.

Martin
0
 
b2piCommented:
Actually, you might be right.  However,

1.) You did phrase yours as a question, rather than a statement.
2.) As you mentioned, I did give a few more details.

I must admit, again, that I am utterly flummoxed by the practive, observed by many (you and ozo, to name 2) of issuing comments rather than answers.  Could _someone_ explain this?

jag, in deference, please reject my answer, and allow martin to post one for the points.
0
 
martinagCommented:
b2pi, whenever the user finds the solution satisfactory I will post an answer.
Very often (especially in programming) the problem depends on many things, such as OS, browser version, perl version or something in the code two pages up. If something like that makes the answer not work, then it is not an answer. Or?

I am aware that one must use double quotes in Windows 95 using my perl version, but since NT is said to be better than Windows 95 and I don't know about what perl version jag uses I was not sure that was the problem. That's why a comment and that's why a question mark.

Anyway, you may have the points. I've learned someting new about NT's shell from this and learning is the reason we're all here, right? Gee, I even answered my own comment!

jag, accept b2pi's answer if it works for you. Speaking of curiosity...are you from Sweden?

Martin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now