Click to See Complete Forum and Search --> : Perl question
Bates
01-17-2001, 02:11 PM
So what is an anonymous array? How is it different than a normal array and why would I want to use it?
I'm having some difficulty with this part of perl....
------------------
on email puppy machine. Pity me.
dreamin of buildin a new one September 1, 2001.
Sketch
01-17-2001, 04:29 PM
Anonymous arrays are non-indexed. In a normal array, each cell is given a name or number, but in an anonymous array, it is not. They are treated only as a whole, and can't be separated and treated as parts.
------------------
Despite the high cost of living, it remains popular.
[This message has been edited by Sketch (edited January 17, 2001).]
Grizzly
01-17-2001, 04:52 PM
I was actually astonished that you could make anonymous arrays like that. Perl is a VERY forgiving language it seems. There's only 2 data types, and you don't have to initialize any variables. Jeeeez, makes for a nice and easy web language, thats for sure.
Sketch
01-17-2001, 06:46 PM
I agree. I program in Perl professionally and have developed a love/hate relationship with its lax handling of varaiables. I don't know if you've ever worked with PHP or not, but it is even worse. There is only one (that's right one) data type and the language adjusts its actual type based on usage. Perl does something similar but not to the same extent.
The laxness of it makes it (Perl) an easy language to program in and to learn, but I have to *strongly* discourage anyone from taking it up as their first programming language. It doesn't reinforce good programming practices, and is in fact very detrimental. Anyone who learns it as a first language is going to struggle later on as they tackle more strongly typed (or even at all typed) languages like C++, Ada, and Java.
------------------
Despite the high cost of living, it remains popular.
Bates
01-17-2001, 09:40 PM
Well PERL isn't my first language I've worked with, I took the old first semester of PASCAL back in my first year of college but it's been a while and I was never top o da class. I"ve also just worked with Javascript. Currently we are taking a course in PHP/ASP and then taking JAVA next month. I'm not to bad at perl, but the anon array thing is kinda nutso. oh well shebang! for everyone
------------------
on email puppy machine. Pity me.
dreamin of buildin a new one September 1, 2001.
Grizzly
01-18-2001, 09:08 AM
Originally posted by Sketch:
I don't know if you've ever worked with PHP or not, but it is even worse
You bet it is. Heh, I was honestly amazed...almost offended at how simplfied these languages are. It just goes to show that there's a fine line between a programming language, and a "scripting" language.