in reply to Splitting on uppercase letters

Here are 2 solutions:

#!/usr/bin/perl -w use strict; my @data= map { chomp; $_ } <DATA>; my @methods=( '@strings= map { lc } split /(?=[A-Z])/, $_', 'while( m{([A-Z][^A-Z]*)}g) { push @strings, lc $1; }', ); foreach my $method (@methods) { print "using $method:\n"; foreach (@data) { my @strings; eval( $method); print " $_ => /", join( "/, /", @strings), "/\n"; } } __DATA__ ThisString SomeOtherString