Well, I would normally have left the named array off and just done it with a simple scalar, but since the questioner is a newbie to perl, I wanted to show where the values end up when you use () and when you use just a scalar. I read a funny article in perl journal years ago (it was satire) in which the guy was supposedly using perl for military technology and forgot the () in the tolerances, so he was getting a "1" because it was the count of matches, rather than the value of matches.
Yeah, I find that interesting as well. Perl is amazing - thanks Larry!
I told a co-worker that I use perl everyday and he said "I hate that language" so I immediately lost all respect for him (haha).
You're right tr/// is better and more efficient. I sometimes use some old tricks because I have never had anyone actually teach me perl, just figured out by doing. I am now writing (most) everything object oriented in perl - which I hadn't before because I wrote most stuff very C-like.
Well, we are in the same boat, I never learned perl formally either. Last time i was in school I was learning how to write programs on punch cards. Which totally turned me off to programming for a very long time. ;)
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...