in reply to Split without removing characters

Another approach
my $foo = "Hello WorldFoo BarPerl MonksSlash Dot"; for ($foo) { for (/[A-Z][a-z]+/g) { print "$_ \n"; } }

Replies are listed 'Best First'.
Re^2: Split without removing characters
by Transient (Hermit) on Jun 17, 2005 at 20:25 UTC
    __OUTPUT__ Hello World Foo Bar Perl Monks Slash Dot
    although
    for ($foo) { for (/[A-Z][a-z]+(?:\s[A-Z][a-z]+)+/g) { print "$_ \n"; } }
    would work.