in reply to Dividing a string into multiple substrings of different length

One minor side point: the "generally accepted, Perl-ish" way to get the argument(s) in your sub would be:

my $DC = shift;

which is equivalent to:

my $DC = shift @_;

Your code is ok, but Perl was designed to help you avoid having to use "ugly" array index notation. If you look at much Perl code going forward, you are likely to see this type of thing expressed with the "shift" operator much more often than the way you have it written.

--Nick