You may want to clean this code up a bit. Namely, the
$num_of_elements variable is unnecessary and your check for '14' items should check for 14 items instead. Something like:
#make sure we have the right number of elements
carp "Incorrect number of elements" if @array != 14;
#continue with the program...
Since you're checking the
@array against a number it's automatically in scalar context. Also, putting it in one line allows you to continue your program without wrapping a large chunk of code in an if statement, which could confuse readability (
where did this `}' come from?).
Hope That Helps,
jynx