in reply to Re: RegEx misbehaving?
in thread RegEx misbehaving?

Dropping the indexing using $i and replacing it with push wouldn't be exactly the same because at the moment $i is incremented on every line of the file, rather than just on those which begin with 'R'. In the original version the ith element of each array contained information about the ith line of the file, whereas using push would mean that ith element of each array contained information about the ith line to begin with 'R'.