in reply to split but preserve the matching pattern
Gives$data =<<EOL; command = adb asd 2t525 command=adfaf adsgadg asd EOL @commands = split /(?=command)/,$data; foreach (@commands){ print "$_\n"; print "==========\n"; }
command = adb asd 2t525 ========== command=adfaf adsgadg asd ==========
|
|---|