Solved

Perl -e question

Posted on 1998-11-04
7
167 Views
Last Modified: 2010-03-04
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
Comment
Question by:jaq
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1205985
perl -e "print 1+1;"
?

Martin
0
 
LVL 5

Accepted Solution

by:
b2pi earned 50 total points
ID: 1205986
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
 
LVL 4

Expert Comment

by:martinag
ID: 1205987
This is the kind of things that makes you wonder what you're doing around here...

Martin
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:b2pi
ID: 1205988
What do you mean?
0
 
LVL 4

Expert Comment

by:martinag
ID: 1205989
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
 
LVL 5

Expert Comment

by:b2pi
ID: 1205990
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
 
LVL 4

Expert Comment

by:martinag
ID: 1205991
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now