thanks, this is all very helpful. I would like to point out that I already knew about $array[-1] for the last element, if you check out the middle of the code. But thanks again, I've got lots of stuff to work with!
if you undef $/; then you can say my @array = split /\n+/, <DATA>; and this will ignore all the empty lines.
Update
Sorry about the minimalist post - didn't have any time earlier. The reason this works is that $/ (newline by default) is used as the end-of-line character when reading from a filehandle. If you undefine it then no end of line is seen and the whole file is "slurped" in, in one go. "split"ting this on one (or more) newlines does the "chomp"ing for you while also returning a list. hope this makes it a bit clearer.