in reply to Re^3: Split a variable at a Given Line-Number
in thread Split a variable at a Given Line-Number

To quote the original problem:
variable into two separate variables where one variable contains the last 15 lines of text (including any newline characters) and the other contains the rest.

(emphasis by me). Somehow I fail to see two separate variables in your "solution".

  • Comment on Re^4: Split a variable at a Given Line-Number

Replies are listed 'Best First'.
Re^5: Split a variable at a Given Line-Number
by LanX (Saint) on May 18, 2010 at 13:42 UTC
    Granted, but you should care about trailing empty lines.

    Cheers Rolf

    UPDATE:

    for completeness ($pre,$post)=split /((?:\n.*){16}$)/,$txt