I'm currently 开发者_开发知识库trying to do some string based manipulation in an attempt to speed up a section of traditional Perl code. The original Perl code looks like
my $value = 'abCdE';
my $uc_value = uc($value);
I've looked at the Perl guts API and it seems that I can accomplish this using toUPPER()
but this works on a single char at a time. I seem to be missing how you can loop through the backing char array, uppercasing each letter & then assigning it into a new SV.
Any help is much appreciated.
Perl does not provide a lot of its functionality to C level extensions, uppercasing is apparently one of those features. At best, you can look at how the core implements this, but it's really not all that pretty.
精彩评论