I was thinking putting each line into an array, and counting up to the 5th spot, and deleting until i reached the n-4th element and stopping...
This is Perl, not C. In Perl, strings are first class citizens. Do not think of strings as arrays of integers.
delete everything after the first 4 characters, until the 4th to last character?
The point of the exercise here isn't deleting. It's selecting. Selecting based on character count. Use
substr for that. And since it's a class assignment, I leave it to this.