quote:Original post by Bad Monkey I personally think the syntax and readability of it is atrocious... some programs I have seen are like trying to read a Chinese restaurant menu...
Perl is a very powerful, AND useful, language, but not much used for graphics. It's one of my languages of choice, I use it at work for web-applications, when I do graphics programming at home (for fun) I mainly use c/c++ but use Perl to generate/convert vertex data and such.
Today Perl is mostly used for system administration and web-related programs (not only CGI). Some of these are small scripts of 10-20 lines, but there's big object-oriented packages out there in the world (I know, I've been working on 2 of them). The object-oriented features are sort of bolted on, but they ARE powerful. And you can rewrite them (in Perl) if you fancy, Damian Conways "Object Oriented Perl" has a lot of neat information if you're interested.
You can find a lot of bad/unlucid written Perl code, but thats true for every other widely used language. Some people hate the syntax, it can be a bit wierd with "open FILE or die" and stuff like that, but on the other hand, think of the first time you saw C: "void" this and that, and "*whatnot = something".
For Game Programming I think Perl would be most useful if embedded in an engine written in c++. I've been looking for examples on the web, but have found that python is much more used in this area. For example, the Crystalspace engine has support for embedded python, with source-code. Mind you, they use a generic scripting interface called SWIG, so maybe their code could easily be converted to perl.
Python-programmers love to dis perl, so I've always disliked python a bit for that reason :-) , but seriously, python seems to be a decent language, but in a lot of small ways more different from c/c++ than perl (not using braces to delimit code-blocks, no semicolons at endline, indention for structure) so I think it'll be difficult to switch quickly (ie a couple of secs) between code written in python and c++. But apparently a lot of other people have coped with that :-) .
Some comments on your reasons for liking perl:
+ No declarations, variables are made when there used Thats NOT a good thing, misspelled variables won't get caught. Add "use strict;" at the top of your program. Declare all variables with "my".
+ No types, just like java-script Note that there ARE types in perl, it's just that a normal scalar variable can be assigned a value of any type. Perl is what is called a weakly typed language or maybe its weakly type-checked language, like python, ruby and a host of others, including, I think, smalltalk. Note that this is both a boon and a blessing. If you call a method on an object (eg $obj->method) there's no check at compile-time if $obj is a type which has "method()" defined, like there is in c++ or java, which can make inheritance much easier. However, at run-time the program will throw an exception (die actually) if it can't find a "sub method" in $obj's namespace, so you better be sure that this won't happen, OR add code to handle the exception (eval {...}; if ($@) {...} ).
+ Condition false controls. Like unless and until. Actually I try to avoid these in my code but YMMV.
+ Cool array features like being able to find out how big it is real easy and commands like pop and push and sort. Have you checked out Map and Grep? Perl is array-heaven :-)
+ Pretty much everything else that is in a high level language. Plus it can be script or binary. ??? I've seen .EXE-converters for windows, but I don't think they actually make the program any faster, if thats what you mean.
Another Poster said something about "lack of libraries". Try to take a look at www.cpan.org.
--------- "It's always useful when you face an enemy prepared to die for his country. That means both of you have exactly the same aim in mind." -Terry Pratchett
[edited by - deformed rabbit on June 9, 2002 9:38:50 AM]
---------"It''s always useful when you face an enemy prepared to die for his country. That means both of you have exactly the same aim in mind." -Terry Pratchett
Thona, I know about the stl and use it in almost every program I write. However, Perl''s handling of many things is alot more natual feeling than C++''s. Sure I could include the libararies, declare a string class and then use that but with Perl all it takes is $word = "word"; Pretty much the same thing holds true for vector. I will however agree with some of the stuff said about Perl syntax. To many symbols...
I think there's to much blood in my caffeine system.
The STL is good and all, but it''s got nothing on perl''s string manipulation and file-processing functions. But like I said before, perl isn''t meant for writing games.