This doesn't work exactly as you imagined, but a captured pattern in split will be included in the resulting list.
$_ = 'abcfoodefbarghibaz'; my @parts = split /(foo)/; print "@parts",$/ __END__ abc foo defbarghibaz
After Compline,
Zaxo
In reply to Re: split but not consumed
by Zaxo
in thread split but not consumed
by jcpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |