in reply to Simple regex
You might also consider using split() and use its optional third parameter to tell it to only break it into two chunks.
my( $before, $after ) = split /$breakline/, $content, 2;
If you $breakline might have regex special characters in it, you might want to escape those with either quotemeta() or the \Q.
my( $before, $after ) = split /\Q$breakline/, $content, 2;
|
|---|