in reply to Splitting a string

Here's my shot at it:
#!/usr/bin/perl use strict; use warnings; my $string = 'perl monks'; my $space = qr/\s/; for (0 .. (length $string) - 2) { my $match = substr($string,$_,2); next if ($match =~ $space); print "$match\n"; }

Added: This thread shows that TIMTOWDI is alive and well!