Tested with AS 5.8.9, should work (but untested) with pre-5.8:
>perl -wMstrict -le "my $s = qq{line 1\nline 2\nline 3\nline 4\n}; my $l = 2; my @sra = $s =~ m{ (\A (?: [^\n]* \n){$l}) (.*) }xms; use Data::Dumper; print Dumper \@sra; " $VAR1 = [ 'line 1 line 2 ', 'line 3 line 4 ' ];
In reply to Re^5: Split a string at a given line number
by AnomalousMonk
in thread Split a string at a given line number
by danj35
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |