sub substrings { local $_ = shift; my @result; do { push @result, /(?=(.+)$)/sg; chop } while (length); return @result; }