Do you want to have the entire file in memory? What do you plan to do with it, apart from removing comments? For any one line of the file, s/^'.*// will clear the comment text, leaving a blank line in its place.
Caution: Contents may have been coded under pressure.