Simple answer: don't reinvent the wheel, use someone else's wheel that works.
Update: And as to your error message, your array initially doesn't have anything in it so $#array is -1. -1 elements from the end of an empty array isn't a valid index. See perldiag. Which means that your file doesn't start with a 'From ' line, or at least not one which matches the regexp you're trying to use.
In reply to Re: Spliting an mbox file
by Fletch
in thread Spliting an mbox file
by monger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |