in reply to Re^2: Parse text file data to send a mail.
in thread Parse text file data to send a mail.

Finally I need all data fields (subject,body etc.) into separate variables to pass it to send a mail.

That isn't necessary. You can use the values directly from the hash. eg:

print MAIL "Subject: $parts{SUBJECT}\n\n";

See Not Exactly a Hash Tutorial for more on how to use hashes.