in reply to Capture Lookahead
Another regex solution.
#! /usr/bin/perl # use strict; use warnings; use re 'eval'; my $str = do {local $/; <DATA>}; $str =~ s/\s+//g; for (my $len = length $str; $len > 1; $len-- ) { $str =~ /(.{$len})(?{print "$1\n"})\b/; }
|
---|
In Section
Seekers of Perl Wisdom