🔒 Locked
Java vs Perl
Advertisement
Original Post
ok, let me get this straight...and please, by all means correct me if im wrong...
Java is to Perl
as
JavaScipt is to PerlScipt.
Is hat statement true?
I am using Perl to do counters and message board for my webpage.
I was wondering if it can be done using Java (or jvascript)?
and what exactly is the difference between java/perl and java-script/perlscript??!
thanks
~ I am a DirectX to OpenGL convert! ~
I thought Perlscript is what was used to do CGI, not Perl.
Is it possible to write Perl code and run it offof my hardrive...like a Java or C++ program?
Im confused because a long time ago I copied java-script code for a counter and it worked on my website. How could it work if java-script is run on the client-side??
thanks
~ I am a DirectX to OpenGL convert! ~
Is it possible to write Perl code and run it offof my hardrive...like a Java or C++ program?
Im confused because a long time ago I copied java-script code for a counter and it worked on my website. How could it work if java-script is run on the client-side??
thanks
~ I am a DirectX to OpenGL convert! ~
Perl is used by CGIs, and run server side. Yes you could run it on your hard drive, you''d have to run the PERL intrepetor though. Basically you feed your .pl file into the .exe file, and it runs the script. IT DOES NOT compile it, like C++. Perl will never compile, its a script, it runs.
PerlScript is what PHP uses.
Java-Script runs client-side, basically if you have like error checking in a form (to make sure you enter digits in the Zip Code field, lets say) then it would report the error on the client side. In other words, the browser would scream at you, rather then the server screaming at you.
Java is more like C++, as its more application based and not used as a scripting language.
PerlScript is what PHP uses.
Java-Script runs client-side, basically if you have like error checking in a form (to make sure you enter digits in the Zip Code field, lets say) then it would report the error on the client side. In other words, the browser would scream at you, rather then the server screaming at you.
Java is more like C++, as its more application based and not used as a scripting language.
Woah...Perl. Very confusing stuff. I was at a programming contest once, and we had to do some stupid string stuff. Anyway, the team in front of us wasnt doing a thing the entire time. We thought they had given up. We finally finished with about 50 lines of c++. So we ask them what they were doing and they said they were done, and showed us their source. It was 8 lines long, 4 were blank lines.... I was like damn... Well, by the end of the competetion they had finished first, with about 100 points more than anyone else. (We had about 200 at the end, not a bad score)
"cogito, ergo sum" -Descartes
"cogito, ergo sum" -Descartes
quote:
Original post by GekkoCube
Java is to Perl
as
JavaScipt is to PerlScipt.
Java is nothing like Perl.
Java is nothing like java-script. The only reason for the similarity of names is a marketing decision made by Netscape to make ECMAScript more popular, thus they called it java-script (playing off of Sun''s Java).
These languages all serve different purposes and were designed for different problem domains. Perl, as I''m getting tired of saying, was not designed for the web; it was designed as a data mining and sysadmin tool. Read Larry (Wall)''s notes on it in the introduction to any edition of Programming Perl.
Java was designed with the enticing prospect of writing code once and running anywhere without recompilation or relinking. While much improved, the language has succeeded more on hype and anti-MS sentiment than technical merit. It''s useful for writing web applets - medium-to-large applications embedded in webpages, but for small utilities please use java-script instead. Java is a severe amount of bloat just for a counter.
I suggest you STFW for more in-depth information on these languages and related topics.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions ]
Thanks to Kylotan for the idea!
java-script alone on the client isnt sufficient to make a counter - you need something server side to store the counter information. I would imagine it would be pretty easy to write a Java servlet that rendered the count as text on an image and then returned this to the browser. This could then be invoked with
).
The computer was conceived as a tool to reduce complexity. Some people found this loss of complexity unacceptable, and developed UNIX to amend the situation.
<img src="http://myserver.com/counter.servlet"> inside the web page(At least thats how I would do it using ASP.NET and C#The computer was conceived as a tool to reduce complexity. Some people found this loss of complexity unacceptable, and developed UNIX to amend the situation.
quote:
Original post by Arild Fines
I would imagine it would be pretty easy to write a Java servlet that rendered the count as text on an image and then returned this to the browser. This could then be invoked withinside the web page.
That could also be done with Perl or PHP (I''ve seen it done with both, in other words).

Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement