Solved

Perl -e question

Posted on 1998-11-04
7
172 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PERL get the value for query 4 151
perl CPAN issue 3 109
How to get all the API from website? 11 82
Internal Server Error on 1&1 Apache Server running PERL 3 15
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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

12 Experts available now in Live!

Get 1:1 Help Now