That will give you an undef first item, because it matches at the beginning as well as at the end. Adding a lookbehind will solve that:my @names = split /(?=[A-Z])/;
my @names = split /(?<=.)(?=[A-Z])/;
In reply to Re: split by a capital followed by
by Roy Johnson
in thread split by a capital followed by
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |