in reply to Split with data keep
I'm not sure whether I've understood your problem. Can it be that your problem is solved using backreferences in the split// regexp?
@stuff = split m{ <!--end--> <a \s name=" ( \d+ ) "></a> <!--start--> }x => $data;
See `perldoc -f split` to see what happens with your backreference $1.
Another option is to use a parsing while(REGEXP):
--while( $data =~ m{ \G <a \s+ href = " (\d+) "></a> <!--start--> ( .+? ) <!--end--> }xg ){ my $number = $1; my $data = $2; #... }
|
|---|