in reply to how to split based on new line or others ?

In an attempt to teach you to fish:

In addition, don't forget about perlfaq. In this case, perlfaq5 (Files and Formats) may be appropriate as additional questions arise.

HTH