My background in "coding" stems from coding with the terrible PHP. As such, this has not been clearly exposed to me in the same way as some real concepts should be, as their policy seems to stem from "teaching by removing difficult details". As you can see, I'm attempting to adopt Perl as my main language, and feel I should familiarize myself with the philosophies in the concepts prior to that.
So my question to the experienced monks around here is:
What is the difference between an array and a hash as 'types', and why would it be a bad idea for them to be merged into the same data structure? In PHP, it is known as an associative array, where it is something like:
$array = array(1, 2, 3, 4);
$hash = array('red' => 1, 'blue' => 2', 'green' => 3, 'yellow' => 4);
But in Perl, it is quite different. If possible, is an in-depth explanation in order?
I look forward to an answer to this question.