Because split throws away the parts that matched unless you tell it to keep them,
It turns out that capturing forces one element before the separator. ':' is in the second array slot.perl -e'print scalar split /(:)/, q(:)' 2
After Compline,
Zaxo
In reply to Re: split empty (lead|trail)ing fields
by Zaxo
in thread split empty (lead|trail)ing fields
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |